Radio Button submit onclick
-
Hi there! I’ve installed WP Polls on this website: https://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?
- The topic ‘Radio Button submit onclick’ is closed to new replies.