RequiredFieldValidator--write code in javascript
Answers were Sorted based on User's Feedback
Answer / srinivasan
function validate()
{
var Name = document.getElementById("txtName");
if( Name.value=="")
{
alert("Please enter the Name");
return false;
}
}
button OnClick() we hav to cal this function
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / 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 |
Answer / gangadhar
function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
document.getElementById("NameId").focus();
return false;
}
in button OnClick() we hav to cal this function
Is This Answer Correct ? | 6 Yes | 3 No |
how to get modified rows from Dataset
What?s the difference between Response.Write() andResponse.Output.Write()?
What is meant by ispostback in asp net?
Differentiate the session object and application object?
What is the file extension of web service?
What is difference between cache and session?
What is the main difference between hash table and Dictionary?
what is the trace in ASP.NET
Explain the difference between asp & asp.net.
what is PostBack Property exactly ? when It Returns True? when it Returns False?
What are the Types of chaching. How to implement caching
What are clr?cts?cls?
4 Answers e4e, HCL, Microsoft, Tata Communications,