Hello guys,
I have a page with two forms. Their ids are "delete" and "add". For the the delete form I also have a small piece of script that on submit asks if I'm sure I want to delete the selected entries:
$('form#delete').submit(function(){
if(confirm('Are you sure you want to delete?')) {
return true;
} else {
return false;
}
});
Everything works fine for this form, but when I want to submit the second form I also get that confirmation popup. How can I get rid of that and submit the second form right?
Bellow are my two forms
<form name="delete" id="delete" method="post" action="index.php?action=delete">
<input type="checkbox" name="delete_all" id="delete_all" value="" />
<input type="checkbox" name="car[]" class="delete_checkbox" value="1" /> First car
<input type="checkbox" name="car[]" class="delete_checkbox" value="2" /> Second car
<input type="checkbox" name="car[]" class="delete_checkbox" value="3" /> Third car
<input type="submit" name="submit_delete" value="Delete" />
</form>
<form name="add" id="add" method="post" action="index.php?action=add">
Car name: <input type="text" name="car_name" value="" />
Car owner: <input type="text" name="car_owner" value="" />
<input type="submit" name="submit_add" value="Add" />
</form>
Thank you.
Lated edit: it was a stupid error, sorry guys, one form tag wasn't properly closed.