I want to have a confirmation from the user before they submit a form. This will prevent accidental POSTing of the form, that may be incomplete or incorrect.
Here is my
You're doing it the other way round!
if(confirm("Do you wish to update details?")) { return 1; } else { return 0; }
Having said that, your code can be shortened to just one line:
return confirm("Hit OK to continue, Cancel to... cancel.");