0

I try to add Poll-voting to my website, on page I addet 5 votings forms, I try to make submission of all 5 forms by one click instead of 5 clicking. I wrote this script :

 <script language="javascript" type="text/javascript">
      function submitDetailsForm() {
           $('#poll-view-voting').submit();
       }
 </script>

But this code submit first form only(the forms has one id). Console.log retrieve this:

[form#poll-view-voting, context: document, selector: "#poll-view-voting", init:  function, jquery: "1.4.2", size: function…]
0: form#poll-view-voting
context: documentlength: 1
selector: "#poll-view-voting"
__proto__: Object[0]

How i can solve this issue, help please. I am new in Drupal 7 and JS.

1
  • 1
    You can't submit more than one form at a time, your browser won't let you. You're also using an ID as a selector, which by definition means you'll only get one element back (unless your markup is wrong). Not 5. It's hard to see how this would have anything to do with Drupal beyond the fact your markup is being generated by Drupal - could you edit the question to confirm why you feel this is a Drupal (and not Javascript) problem? – Clive Oct 9 '14 at 8:48
0

Use Advanced Poll module. I think this may help you to solve your query.

1
  • i try to use this, but i still have same result. When i create new poll i get single form. – nowiko Oct 9 '14 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.