Question : Stop a submit with javascript...

I have a form in PHP that will submit $_POST to a script for processing.  Right now I have a confirmation box (javascript) that pops up when the 'submit' button is clicked asking 'Are you sure?', but either way the form gets processed . . . How can I stop the form from being processed if the user clicks 'Cancel'.




HTML/PHP


....form inputs....



JS
function confirmSubmit(){
if(confirm('Are you sure?')){
return true;
} else { return false;}
}


I suck.

Answer : Stop a submit with javascript...

An even simpler way to do it would be:

Random Solutions  
 
programming4us programming4us