Forum: Ruby on Rails confirmation dialog on a submit button

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
14b7344777a56ac9a1fad849f5d6da2a?d=identicon&s=25 sayoyo (Guest)
on 2007-02-16 20:20

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

361ba1bcc1d2c5a8885dd093dbb96bb6?d=identicon&s=25 Michael Kovacs (Guest)
on 2007-02-16 20:27
(Received via mailing list)
You can try this:

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

F148ec0cad8ea241b1cfd80e7ec8a7df?d=identicon&s=25 Fredrik (Guest)
on 2007-02-16 20:29
(Received via mailing list)
Try this if you are typing the html
<input type="submit" value="submit" onClick="return
if you are using the submit_tag helper method, I believe you can just
add the :confirm to it.

361ba1bcc1d2c5a8885dd093dbb96bb6?d=identicon&s=25 Michael Kovacs (Guest)
on 2007-02-16 20:32
(Received via mailing list)

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.

7efa1e84afccfab2ab6c528afae4d2aa?d=identicon&s=25 sayoyo (Guest)
on 2007-02-16 21:26
Hi Michael,

Thanks you very much for the information!!!

This topic is locked and can not be replied to.