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!

Comments

prashant.c’s picture

I made this modification and it worked for me. Thanks

pavel ruban’s picture

Status: Active » Fixed
StatusFileSize
new1.1 KB

I 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.

pavel ruban’s picture

Status: Fixed » Patch (to be ported)
podinfo’s picture

Issue summary: View changes

thanks very much #pavelRuban

pavel ruban’s picture

jenlampton’s picture

Status: Patch (to be ported) » Needs review

I 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?

sgdev’s picture

A few comments about this patch.

I agree with the removeAttr adjustments. Those are absolutely necessary.

I also agree there needs to be a call of $pollWrapper.find('.messages').remove(); However, by putting it in success, it does not handle this issue: https://www.drupal.org/project/ajax_poll/issues/2666930

It needs to be in beforeSubmit too, 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 $form generates 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.