I want to create a Confirm message if the user klicks on my submit button. I've created the submit button with the Laravel Form package. Well, I don't really work with javascript and haven't found an answer for that.
Thats my submit Form:
{!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
I tried something like this:
<script>
function ConfirmDelete()
{
var x = confirm("Are you sure you want to delete?");
if (x)
return true;
else
return false;
}
</script>
{!! Form::submit('Delete', ['class' => 'btn btn-danger', 'onsubmit' => 'return ConfirmDelete()']) !!}
But this haven't worked. Can anyone help me there?
console? Care to elaborate haven't worked!HTML