jquery.AreYouSure
jquery.AreYouSure copied to clipboard
Toggle button tag rather than submit input breaks change event
If i use a button instead of an submit input, the change event will stop working.
I use the code below, which is very similar to your example.
change = () ->
$form = $(this)
$button = $form.find('button')
if $form.hasClass('dirty')
$button.removeAttr('disabled');
else
$button.attr('disabled', 'disabled');
$('form').areYouSure({change: change})
My form is pretty standard form with some radio buttons. If i toggle the radio buttons and turn off the removeAttr line, it will work fine. When I reenable it, it will work the first time and never fire again.
Any idea what is wrong?
Is this related to the pull request #73 ? Did this change fix the issue?
I think it fixed it. I have only tested it in chrome so far. I'm not too sure how your code works, but the exclusions in your fields selector seemed to imply the fix to my issue.
I know the some browsers (cough...ie..cough) had issues before with the button tag, but its been a while since i have seen them.