WordPress.org

Support

Support » Plugins and Hacks » Radio Button submit onclick

Radio Button submit onclick

  • Hi there! I’ve installed WP Polls on this website: http://test.2minaudition.com/
    You will see that I have two options that a user can vote for, basically Option 1 or Option 2.

    My goal is to make it so that a user can click a submit button to vote for one of the options, rather than selecting the radio button and then hitting “submit.” Let me put it in steps:

    1) Remove the Submit Button (which I’ve done)
    2) Change the Radio Button to a Submit Button
    3) To vote, the user simply clicks the appropriate Submit Button.

    So far I’ve been able to convert the inputs to buttons, but the onclick doesn’t work (you get a pop-up saying, “please choose a valid poll answer”)

    The original Input Body:
    <input type="%POLL_CHECKBOX_RADIO%" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> <label for="poll-answer-%POLL_ANSWER_ID%">%POLL_ANSWER%</label>

    My recoded Input Body:
    <input type="button" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value=" %POLL_ANSWER% " onclick="poll_vote(%POLL_ID%);" />

    How can I get this sucker to work?

    http://wordpress.org/extend/plugins/wp-polls/

Viewing 3 replies - 1 through 3 (of 3 total)
  • like many others i’m interested in this solution as well.

    in a poll where there are say 3 options, i would prefer to use three buttons (not radio buttons)

    whenever the button is pressed, it automatically makes the vote. faster for the user, less space on the page.

    there is no need for a ‘vote’ button in this method.

    what is the code needed to enter in the form section of your settings page?

    kind regards.

    i’m interested in this feature as well. how can we get it done?

    I’d be very interested too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Radio Button submit onclick’ is closed to new replies.