Confirmation dialog on a submit button


I have a form and a submit button, I try to display a confirmation
dialog before the submit button trigger the action, (it confirmation is
negatif, action will not be triggered.) I know I can to this with
link_to( :confirm=>‘sentence?’) but can I do the same thing with a
normal submit button, and how???

Thanks you very much


You can try this:

Or there’s something that was posted on errtheblog called redbox.
I’ve not looked at it myself.



Apologies… I misread your request. Ignore my previous suggestion.
That was for a modal dialog with a form that you’d like to submit via
an AJAX request.


Try this if you are typing the html

if you are using the submit_tag helper method, I believe you can just
add the :confirm to it.


Hi Michael,

Thanks you very much for the information!!!