I found the bug in ajax_poll.js:
now it is:
$form.find('.messages').remove();
and should be:
$pollWrapper.find('.messages').remove();
Thanks for this module, very good job!
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | ajax_poll-multiple_messages_and_disabled_submit-1417230-7.patch | 2.63 KB | sgdev |
| #2 | ajax_poll-multiple_messages_and_disabled_submit-1417230-1.patch | 1.1 KB | pavel ruban |
Comments
Comment #1
prashant.cI made this modification and it worked for me. Thanks
Comment #2
pavel ruban commentedI get this issue too & resolved it, but I had else one error:
When you don't choose any radio & click submit - form won't be validated & submit stay disabled, so you cant send new request untill page be reloaded. (reproduced in firefox). fixed.
Comment #3
pavel ruban commentedComment #4
podinfo commentedthanks very much #pavelRuban
Comment #5
pavel ruban commentedComment #6
jenlamptonI don't see a Drupal 6 (or Drupal 8) patch here that needs to be ported. I think maybe the status should have been Needs Review?
Comment #7
sgdev commentedA few comments about this patch.
I agree with the
removeAttradjustments. Those are absolutely necessary.I also agree there needs to be a call of
$pollWrapper.find('.messages').remove();However, by putting it insuccess, it does not handle this issue: https://www.drupal.org/project/ajax_poll/issues/2666930It needs to be in
beforeSubmittoo, so it ensures there are not duplicate error messages when not selecting an option and clicking "Vote" multiple times. To simplify things, I just added the line to this patch and closed the other issue.There is one other problem not being handled by this patch or any other I've seen. When a
$formgenerates an element using#submit, the assumption is being made by Ajax Poll that it is always rendered as<input>. This is just not the case, as for many sites the form button will be rendered as a<button>tag.I've updated the patch in #2 to be more flexible and allow a site to use either
<input>or<button>as form submits.Please review, thanks.