-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Description
I'm using jquery-rails 2.2.0, but I believe this is actually a jquery-ujs bug. The problem is that confirmation alerts on <button> elements work when the element is within a form, but not when the button is outside the<form> element and uses the form attribute to refer to the form. So, for example:
<form id='my-form' action='whatever'>
<button type='submit' data-confirm='Are you sure?'>Button 1</button>
</form>
<button type='submit' form='my-form' data-confirm='Are you sure?'>Button 2</button>In this case, button 1 shows the confirmation alert. Button 2 does not, but simply submits the form. (I'm using Rails 3.2.13, Chrome 35, and Mac OS X 10.9, FWIW.) It doesn't look like any JavaScript errors are being thrown.
Am I doing something wrong, or is this an actual bug?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels