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
What is the concept of postback in asp.net?
What are the disadvantages of view state?
When should I use server transfer and response redirect?
How do active server pages work?
Why do we need master page in asp.net?
Explain diff. Betn dataset and recordset?
What is an asp.net validator? And, mention its types.
From which base class all web forms are inherited?
Fetch one page value to another page without using state-managment ?
What is the difference between custom controls and user controls?
Explain http handlers? Where we can use the http handlers?
What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
What is redirecting behavior?
Which namespace is used by ado.net?
What are the 3 levels at which content pages can be attached to Master Page?