I am trying to use the onClick event in a form to test to see how to to prevent the form action form be perfromed.
I the onClick line:
The form starts with:
The form action is still being performed even though I stated return false in the js code. Why is this happening and how can I solve it?
I the onClick line:
Code:
<input type="submit" name="submit" value="Submit" onClick="testaction()" /></p>
The form starts with:
Code:
<form name="appts" method="post" action= "./include/index_insertDB.php" >
The form action is still being performed even though I stated return false in the js code. Why is this happening and how can I solve it?
Code:
var errmsg("testing");
if(errmsg.length > 0) {
alert(errmsg);
return false;
}
else {
return true;
}