hello,
im having a problem with my javascript. im using confirm on the onclick event of my button, the problem is whenever i press cancel it still continues to submit the form, how do i stop that?
sample:
<input name="del_submit" type="submit" onClick="confirm_delete()" value="Delete">
the code for confirm delete is this
function confirm_delete()
{
if (confirm("Are you sure?"))
{
document.form1.submit();
}
else
{
// donot submit
}
}
is there something wrong with my code?
tnx