Hi,
Rewrite the javascript fucntion as follows.
fucntion Validate()
{
var valfirst= document.getElementById("FirstName").value;
if(valfirst == null || valfirst == "")
{
document.getElementById("FirstName").focus();
return false;
}
var vallast= document.getElementById("LastName").value;
if(vallast== null || vallast== "")
{
document.getElementById("LastName").focus();
return false;
}
}
Do the HTML page modifications as follows.
<html>
<body>
<script type="text/javascript" src="External.js">
</script>
<form id="frm1" method="get">
First Name: <input type="text" id="FirstName"/>
Second Name:<input type="text" id="SecondName"/>
<input type="button" value="Submit" onClick="validation()"/>
</form>
</body>
</html>
Regards,
Kiran