I ask the user "Are you sure?" when clicking on a form submit button:
{{ Form::open(array('url' => 'myhome/pic-remove', 'onsubmit' => 'return confirm(\'Are you sure?\');')) }}
And I deactivate the submit button on click:
$('#submitbutton').click(function() {
$('#submitbutton').hide();
$('#isloading').show();
});
The Problem is, the submit button is also deactivated, if the user 'is not sure' and clicks 'cancel'.
How can I deactivate the submit button only if user 'is sure' on the first question and clicks 'ok' ?
edit:
ok i have it like this now, seems to work
$('#submitbuttonconfirm').click(function() {
var r = confirm('Are you sure?');
if (r == true)
{
$('#submitbuttonconfirm').hide();
$('#isloading').show();
return true;
}
else
{
return false;
}
});