RequiredFieldValidator--write code in javascript
Answer Posted / 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 |
Post New Answer View All Answers
What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?
What are the asp.net security controls?
What are the modes of updation in an updatepanel?
What is state management technique?
What is http post action?
Write code to send e-mail from an asp.net application?
What is session authentication?
What is the use of global.asax file?
What is State Management in .Net and how many ways are there to maintain a state in .Net? What is view state?
What is an assembly? Explain its parts.
How do you open a page in a new window?
How can you handle unmanaged code exceptions in asp.net?
Explain the boxing and unboxing concept in .net?
What is the page life cycle in asp.net?
What is asp.net with mvc? : Asp.Net MVC