Home › Forums › Quform WordPress › Preselect muliple choice radio with jquery
- This topic has 4 replies, 2 voices, and was last updated 8 years, 4 months ago by Ally.
- AuthorPosts
- November 6, 2015 at 3:13 pm #17354jerkskiParticipant
Is it possible to preset a multiple choice radio with Jquery? I am trying to set a gender radio selection based on what is stored in a function variable. My multiple choice options and values are the same to make troubleshooting easier. What I need is for the form to load data (which it already does for text fields) and set the radio selection based on the value.
Here are my attempts. Neither of them select a radio option:
function populate_suggested(idd)
{
jQuery(‘.iphorm_2_14’).val(jQuery(‘.’+idd).data(‘gender’)).prop(‘selected’, true);
}function populate_suggested(idd)
{
var gender = jQuery(‘.’+idd).data(‘gender’);
jQuery(‘.iphorm_2_14’).val($(‘.gender’)).prop(‘selected’, true);
}Any thoughts? Again, I can set all other quform fields types with this method, just not multiple choice. Thank you!
November 9, 2015 at 2:19 pm #17370AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 9, 2015 at 5:08 pm #17397jerkskiParticipantThat fixed it! Thank you Ally! Awesome support as always!
November 24, 2015 at 4:50 pm #17518jerkskiParticipantHi Ally, related to this…when I try to submit the form data, even though the gender radio is chosen, the submit logic thinks that it is not. Is there something else that I am missing that would prevent it from submitting? Visually, it shows the proper radio is selected.
November 29, 2015 at 12:09 pm #17526AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.