Duplicating Dropdown Fields

Home Forums Quform WordPress Duplicating Dropdown Fields

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  mbaker 13 hours, 42 minutes ago.

Viewing 5 posts - 1 through 5 (of 5 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 1 week, 4 days ago by  mbaker.
    • This topic was modified 1 week, 4 days ago by  mbaker. Reason: The code I'm imputing is not showing properly
    • This topic was modified 1 week, 4 days 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,

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

You must be logged in to reply to this topic.