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
Differentiate between structure and class.
Is asp net front end or backend?
What does asp.net stand for?
What do you understand by aggregate dependency?
Is it possible to apply themes to an asp.net application? If yes, then how?
What are tuples?
In which event of page cycle is the viewstate available?
Who generates session id?
What is the server of asp.net?
What do you mean by marshalbyref?
What is the differences between a primary key and a unique key in sql server?
What is the behavior of a Web browser when it receives an invalid element?
What are the main differences between asp and asp.net?
Explain the difference between Repeater and Data list control in ASP.NET?
Why we go for mvc instead of asp.net? : Asp.Net MVC