Write a code for "RequiredFieldValidator" in java script

Answer Posted / manoj

suppose the id of the field required to be validated is
NameId

Thus:-

function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
}

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Pre-Render event in ASP.NET?

799


What is a web farm?

756


What is GAC in ASP.NET 2.0

786


How about the security in Activex DLL and Activex EXE ?

2003


Explain the disadvantages of viewstate?

747


Why asp.net is better than php?

677


What is asp net_sessionid?

812


What is the purpose of master page?

693


Is asp.net web forms dead?

716


What are the types of validation in asp net?

725


What is a web api? Which protocol is used in a web api?

731


Explain the boxing and unboxing concept in .net?

576


What is use of Master Page in ASP.NET web pages?

803


Explain the asp.net page life cycle.

769


Which two new properties are added in asp.net 4.0 page class?

696