javascript

Validation Using Javascript

 
<html>
<head>
<script type="text/javascript">
function vali()
{
if(document.myform.FirstName.value=="")
{
alert("Please enter the FirstName");
document.myform.FirstName.focus();
return false;
}
}
</script>
</head>
<form method="post" name="myform" onsubmit="return vali();">
Name : <input type="text" name="FirstName" />
<input type="submit" value="Submit" />
</form>
</html>

Output:
Name :

Wednesday, April 9th, 2014 javascript, PHP, Programming No Comments