RequiredFieldValidator--write code in javascript
Answers were Sorted based on User's Feedback
Answer / srinivasan
function validate()
{
var Name = document.getElementById("txtName");
if( Name.value=="")
{
alert("Please enter the Name");
return false;
}
}
button OnClick() we hav to cal this function
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / amit das
function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
document.getElementById("NameId").focus();
return false;
}
or
function validate()
{
with(document.formname)
{
txtboxid.value == ""
alert("Please enter value");
txtboxid.focus();
return false;
}
}
or we can use
document.form.txtboxid.value
instead of
document.getElementById("NameId").value
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / gangadhar
function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
document.getElementById("NameId").focus();
return false;
}
in button OnClick() we hav to cal this function
| Is This Answer Correct ? | 6 Yes | 3 No |
Explain what a diffgram is, and a good use for one?
What are Session states available and its Uses?
What is odata in web api?
What is Difference between Callbacks and Postback in ASP.NET?
How does VB.NET/C# achieve polymorphism?
how can u create the forms authentication?and what is the difference between forms authentication and windows authentication?
To load your generated dataset with data which method do you invoke?
What are HTTP handlers in ASP.NET?
What is the difference between sealed vs static class?
Explain what are delegates?
What is the difference between User Controls and Master Pages
22 Answers Deloitte, IBM, IntraLogic, Markit, TCS,
Give me one example of Web API Routing?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)