Write a code for "RequiredFieldValidator" in java script

Answer Posted / sudhakar sakthivel

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

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define globalization and localization.

567


What are the properties of the eventargs argument when capturing keyboard events?

547


How does session id work?

492


What is caching? Explain.

551


Why do we use web config?

522






What is a web pool?

588


What are the best practices to follow to secure connection strings in an ASP.NET web application?

558


Can you explain how ASP.NET application life cycle and page life cycle events fire?

569


What is the difference between custom web user control and a custom web server control?

505


What is cached data phone?

530


Explain the differences between clr & cts?

564


Define the steps to set up validation control.

583


What is break mode?

514


How to create events for a control?

551


What is the purpose of session management?

515