Yes,
Could be the problem is "form submitted"
When the alert is displayed, issue the statement
return false;
It prevents from submitting the form
<form name="frm1" action="..." method="post">
<input type="text" name="txt1">
<input type="button" value="Submit" onclick="sbm()">
</form>
<script language="javascript">
function sbm(){
if(frm1.txt1.value==""){
alert("Enter ...");
frm1.txt1.focus();
frm1.txt1.select();
return false;
}
//if all validations are over
frm1.submit();
}
</script>
----------
Rajani
|