Select2 element outside Quform form

Home Forums Quform WordPress Select2 element outside Quform form

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Venom 1 week, 3 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30037

    Venom
    Participant

    Hi Ally,

    I have a simple page with multiple Select2 fields. This page does not contain any Quform form. Since the Quform plugin has defined the jquery.select2 feature embedded in quform.js, that is fine to use the select2 function which comes with Quform.

    I have two Select2 options fields inside the page

    
    <select class="select1-sample" name="state">
      <option value="AL">Alabama</option>
      <option value="WY">Wyoming</option>
    </select>
    
    <select class="select2-sample" name="state">
      <option value="AL">Alabama</option>
      <option value="WY">Wyoming</option>
    </select>
    
    $(".select1-sample").select2();
    $(".select2-sample").select2();
    

    However,only the last selection element (select2-sample) would activate the select2 feature, the first selection element will not initalize the Select2 feature, i.e. plain selection box only.

    Regards,

    Venom

    #30046

    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.

    #30050

    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.

    #30052

    Venom
    Participant

    Hi Ally,

    You are correct. The root cause is the same ID for those select elements that make Select2 from work propertly . Thank you for your great support. Please close the case.

    regards,

    Venom

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy