Write a code for "RequiredFieldValidator" in java script
Answer Posted / rajikiran
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
regards
rajikiran
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
Briefly describe the role of global.asax?
What are tuples?
What is session management in web application?
What is the function of new view engine in asp.net? : asp.net mvc
What language is asp.net written in?
What is asp.net mvc? : asp.net mvc
Explain the advantages of asp.net.
What is the use of session?
What is base class of .net?
If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?
Does google crawl redirects?
What are the new web part controls in asp.net 2.0 ?
What are the different types of validation controls in asp.net?
What is the full form of asp.net?
How will you load dynamic assembly? How will create assesblies at run time?