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 |
List all templates of the repeater control.
What are the disadvantages of view state?
What does clearing cache?
Types of caching ?
Please briefly explain the usage of global.asax?
What is the use of The Page.Master 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?
What is anonymous authentication?
What is the purpose of asp.net?
what is Versioning in asp.net and how it maintain in any web application
What is .NetFramework?
What is custom tag in web.config ?
2 Answers Accenture, BirlaSoft,