Skip to content

:confirm option on buttons (button_to, button_tag) not working for me #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jotto opened this issue May 10, 2011 · 2 comments
Open

Comments

@jotto
Copy link

jotto commented May 10, 2011

the :confirm option on buttons isn't working for me, but works for link_to. i can find no evidence of this breaking for others via google so i suspect i might having something else wrong.

<%= button_to "text", "/", :confirm => "are you sure?" %>

yields

<input data-confirm="are you sure?" name="commit" type="submit" />

but line 159 of rails.js

   document.on('click', 'a[data-confirm], a[data-remote], a[data-method]', function(event, link) {

isn't observing any input buttons. adding input[data-confirm] works for me, but is this suppose to be working without that addition?

@domchristie
Copy link

It appears the *[data-confirm] selector was removed in this commit to fix reliability issues in IE.

I've added input[data-confirm], button[data-confirm] like you said, and it appears to work in IE6/7/8.

@domchristie
Copy link

Update: this is fixed on my fork: (see #11). Looking at jquery_ujs, it appeared that the form button click handler was missing a call to allowAction().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants