Conditional Radio Button Options in JQUERY

Home Forums Quform WordPress Conditional Radio Button Options in JQUERY

This topic is: resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27764
    katw
    Participant

    Hi Ally,

    I want to dynamically generate a radio button group.

    The options within the generated group will be dictated by a previous answer given by the user through a parent radio group.

    This is a JQUERY/Javascript project as the form isn’t submitted so Hooks are out.

    Looking at the structure of your code for div.quform-input-radio and the .quform-options I see an auto-generated form element ID (id="quform_2_81_18a0cd_1").

    Is this a magic value/id? OR can I use any unique ID when I auto-build the radio input group options?

    Code for one radio option:

    <div class="quform-option">
        <input type="radio" name="quform_2_81" <strong>id="quform_2_81_18a0cd_1"</strong> class="quform-field quform-field-radio quform-field-2_81 quform-field-2_81_1" value="DBVALUE">
            <label for="quform_2_81_18a0cd_1" class="quform-option-label quform-option-label-2_81_1"><span class="quform-option-icon-selected"><i class="fa fa-desktop"></i></span><span class="quform-option-text">USERLABEL</span> 
            </label>
    </div>
    

    The above block will be auto-built as some radio button groups have more/less options which means I can’t just change field label or value.

    Thanks for advice.

    #27776
    katw
    Participant

    Hi Ally,

    Just following up to see if you have had a chance to read above.

    I don’t need you to write anything (my job); what I do need is confirmation on your algorithm for generating radio button option IDENTIFIERS.

    If I create my own unique identifier and keep your prefix “quform_2_81_” and trailing suffix “_#” will everything BIND okay?

    So my thinking is:

    I populate the “######” part of the <input id="quform_2_81_######_1" ....> with my own 6 character unique alphanumeric code for EACH auto-generated RADIO GROUP/SET. And I should be okay.

    Yes?

    #27781
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27865
    katw
    Participant

    Thanks for confirming. Close ticket

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy