how to cancel submit event after an submit button has been pressed in a html page?
Printable View
how to cancel submit event after an submit button has been pressed in a html page?
return FALSE in the onsubmit event handler for your form object.
do u have any sample code for my reference?
<FORM onsubmit="return(FormOk());">
...
function FormOk()
{
if( everythingIsOk ) {
return(false);
}
else{return(true);}
}
(Jscript code)
hai lothar..
i tried it out but doesn't work.... i attach the code below... i'm using VB script...
function submitSuccess()
if error then
submitSuccess = false
else
submitSuccess = true
end if
end function
<form onsubmit="submitSuccess()">
is there anything wrong with my code???
thanks in advance....
yes, there is something wrong with your code.
you need to write
<form onsubmit="return(...)"...