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
Where is cookie used in asp.net?
Write code to send e-mail from an asp.net application?
What is the difference between ldap and active directory?
Explain the namespace classes used in asp.net mvc? : asp.net mvc
What is the equivalent of date() and time() in asp.net?
Are cookies stored on server or client?
How can we pass info between 2 asp.net pages?
Is it true that a Web service must be written in .NET or not?
Explain about asp.net 2.0 themes?
What are server activated objects?
What is the function of the ViewState property?
Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?
Name the two properties are on every validation control?
How do you hide the columns?
Define web services in asp.net.