Duplicating Dropdown Fields

Home Forums Quform WordPress Duplicating Dropdown Fields

This topic is: not resolved
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #23724
    mbaker
    Participant

    Hi,

    I have recently upgraded from V1 to V2 of Quform. I have a form I created In version 1 that was used for placing orders. In that form, I was able to add HTML that created an “Add Another” link below a drop-down field so my users could add more than 1 product and associated quantity to the form without being limited. The “Add More” link would duplicate the drop-down field as well as the other fields within that group if applicable. That HTML doesn’t seem to be working anymore to achieve this. I tried replacing instances of “iphorm” with “quform” in the HTML and I updated the element unique IDs and unfortunately it still isn’t working.
    Here is the code that was given to be by a Themecatcher support member (It keeps turning the Add Another text into a link. For full code, view the image attached below) :


    Add another
    <script>
    jQuery(document).ready(function ($) {
    var $field = $(‘.quform_4_37’);
    $field.attr(‘name’, $field.attr(‘name’) + ‘[]’);

    $(‘#add-another-2’).click(function () {
    var $clone = $field.clone();
    $clone.val(”).css({ display: ‘block’ }).appendTo($field.parent());
    return false;
    });
    });
    </script>

    What changes need to be made to make this work again? Thank you in advance.

    • This topic was modified 6 years, 3 months ago by mbaker.
    • This topic was modified 6 years, 3 months ago by mbaker. Reason: The code I'm imputing is not showing properly
    • This topic was modified 6 years, 3 months ago by mbaker. Reason: The code I'm imputing is not showing properly - I've uploaded an image of it instead
    Attachments:
    You must be logged in to view attached files.
    #23789
    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.

    #23847
    mbaker
    Participant

    Thank you for your response.

    I have input the code from the link you provided and it worked for the field I set it for. However, I have multiple fields that need to be duplicated when one is duplicated and other forms that need forms duplicated as well as other sections of forms that need to be duplicated. Regarding those, I have a few more questions:

    1. How can I duplicate multiple fields with 1 single Add/Remove link? An example of what I’m talking about is in Image 1 below.
    2. How do I need to alter the code provided to duplicate another section of fields somewhere else in the same form? An example is in image 2 below.
    3. How do I alter the code to create the same fields as in questions 1 and 2 above in additional forms? In this case, do I just copy the steps from the link you provided and duplicate the same code into the Custom JS and Functions.php file?

    Thank you for your time. Best,

    Attachments:
    You must be logged in to view attached files.
    #23897
    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.

    #23901
    mbaker
    Participant

    Hi Ally,

    I appreciate your response regarding this support.

    In the version 1 of Quform, the support team was able to assist me in these same changes. Unfortunately, the coding for this feature has become more difficult and complex in the version 2 of Quform. In the spirit of maintaining features that were present in Version 1 during this transition, is there someone who can help me with the coding in my number 1 question?

    1. How can I duplicate multiple fields with 1 single Add/Remove link?
    To which your response was: “Within the Add “click” function you’d need to also add the code to clone the Size and Quantity fields and insert them into the correct place, and in the “remove” click remove the last of the cloned Size and Quantity fields”

    While this makes sense, I am not a developer and the code that was provided to me in Version 1 to make this possible is no longer functional. How can this be converted to version 2?

    I appreciate your support and look forward to hearing from you. Best,

    #23947
    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.

    #24321
    Joe Dostie
    Participant

    Hay MBaker,

    What was your solution for multiple fields? I am looking to do the exact same thing you are doing. Any chance you could share the solution?

    I have 1 single filed working, now I want to add a few more.

    Thanks!

    #24362
    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.

    #24479
    mbaker
    Participant

    Hi Ally,

    I have finally had a chance to test the new Add/Remove functionality you created for me. When I follow your steps, it all looks correct, however, I am having some issues when it comes to submitting the form.

    The issue I am having is that none of the fields I have altered are registering when a selection has been made or a quantity has been entered. When I try to submit the form, a ton of red boxes appear that say “This Field is Required”. I’ve attached a screenshot below.

    For background, in order to not effect my website users while I figure this out, I have duplicated the form you altered and am doing my testing on that duplicate form titiled: Screen/Wire/Glass Frames Form MB

    In addition to what you set up previously, I added the Add/Remove functionality to these new fields: Spline, Glazing Tape, Glass Frame

    Here are the steps I followed to repeat the Add/Remove:
    Created Quform Custom Code Plugin
    -This is where I moved your code from the functions.php file and added my new Join Duplicated Fields.
    Javascript to include Add/Remove functionality for each field
    -I did not need to set the size/color for these fields, only the Add/Remove.
    Altered the Select Menu settings
    -Set “Please Select”, removed the option for “Select One” and set the translation to “Select One”.
    -In the Data tab I set “Validate Submitted Value” to off.

    Even the fields you set up previously are having the same error as the new ones I set up in this form.

    You should still have access to the site as an admin.

    Let me know if your login credentials are not working and I will send you new ones.

    Please let me know what I can do to fix this or what steps I’ve missed. I appreciate your help.

    Best,

    Attachments:
    You must be logged in to view attached files.
    #24483
    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.

    #25380
    FFSA
    Participant

    Hi Ally,

    I tested the code and I have the same problem as mbaker.
    When I try to submit the form, a ton of red boxes appear that say “This Field is Required”.

    Thanks

    #25448
    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.

Viewing 12 posts - 1 through 12 (of 12 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