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

Which .NET framework supports Web API?

599


What is a response cookie?

612


What do you understand from custom control?

612


What are validators and list some validators of asp.net?

546


What is query string?

573






How do we implement bundling in MVC?

595


What is class and object in asp.net?

494


What is the difference between user control an custom control?

617


What is paging in context of Memory?

657


Is global asax mandatory?

558


How can we Validate a Controls in ASP.NET page using JavaScript?

635


Define managed code and managed data in .net?

514


What are the different types of proxy patterns?

598


What is the behavior of a Web browser when it receives an invalid element?

630


Which is better union or union all?

564