San, we seem to have lost you in this thread.
To validate on submit you need something like this in your html:
<head>
<script language="javascript">
<!-- Begin
function val_track()
{
if (document.use_track.in_track.value == "")
{ alert ("Please enter the Track no");
return false;
}
else return true;
}
// End -->
</script> </head>
<form name="use_track" action="<?=$_SERVER['PHP_SELF']?>" method="post" onSubmit="return val_track();">
<table border=0 cellspacing=0 cellpadding=5 columns=2>
<tr><td align="right"><input type="text" name="in_track" maxlength="10" size="10" /></td>
<td align="left"><input type="submit" name="go_track" value="search track no" /></td>
</tr>
</table>
</form>
The on submit action belongs to the form not the input button.