have an onclick event for my image
can someone tell me why this submits the form even if a user clicks Cancel
when someone clicks OK i want it to submit the form
with D as the value for the form element
but if they click cancel i want it to do nothing
Code:
onclick= "if (ew_confirm('Are You Sure?')) {this.form.action='custaddcourtcars.asp';this.form.submit();this.form.a.value='D'};"
Code:
function ew_confirm(msg)
{
var agree=confirm(msg);
if (agree)
return true ;
else {
return false ;
}
}
can someone tell me why this submits the form even if a user clicks Cancel
when someone clicks OK i want it to submit the form
with D as the value for the form element
but if they click cancel i want it to do nothing