Duplicate Single Text Field

Home Forums Quform WordPress Duplicate Single Text Field

This topic is: not resolved

This topic contains 9 replies, has 3 voices, and was last updated by  Ally 2 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #20528

    mbaker
    Participant

    Hello,

    I found this article that helped me enable duplicating a text field. (http://support.themecatcher.net/quform-wordpress/guides/customization/duplicating-a-text-field-in-the-form)
    I used the HTML provided in the article and changed the unique ID like it said. I am trying to create a group with a column of 3 single line text fields, (size, quantity and type) all of which need to be able to “add another” simultaneously. I found out by a happy accident that it can do this, but I can’t figure out how it’s doing it and unfortunately, it’s only doing it for my first 2 fields (size and quantity) when you click the size “add another”. (The Quantity and Type “add another” links seem to be broken) Is it possible to get it to “add another” to all 3 fields by clicking the one under Size? To get an idea of what I’m talking about, here is the link to the form I’m building: http://alumaline.net/windows-order-form/#

    Thank you!

    #20537

    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.

    #20538

    mbaker
    Participant

    Thank you so much!This is exactly what I was looking for.

    I tried to include this in different form. I need to perform this action on a couple different areas in the form. I’m coming across a problem when I click “add another” on 1 section, it adds another to all of the appropriate fields, but then it also adds another to fields in a separate section. Is there way around this? Maybe to separate the “add another” links between sections? Here is a link to the new form I’m working on: http://alumaline.net/screening-order-form/
    If you select both “Screen Frame” and “KD Kit”, go their their options, you can see what I’m talking about.

    Thank you

    #20547

    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.

    #21429

    security_man
    Participant

    how would i go about validating this? When you add_filter(‘iphorm_element_valid_iphorm_2_46 if you have added the [] to the end via javascript then the filter never fires.

    #21430

    security_man
    Participant

    well, i am close… this works as a validator, but it shows the error on all the cloned fields… any idea how to add it to only the one that triggers it?

    function required_multiple_validator($valid, $value, $element) {
    	if($element->getName() == "iphorm_2_27" && is_array($value)) {
    		foreach($value as $val) {
    			if(empty($val)) {
    				$element->addError('this field is required');
    				$valid = false;
    				end;
    			}
    		}
    	}
    	return $valid;
    }
    add_filter('iphorm_element_valid','required_multiple_validator', 10, 3);
    #21431

    security_man
    Participant

    one more question… hopefully you can answer all of them at once.

    Once i have the fields cloned and the data sent to the database, how would i create new fields and populate them if i needed users to be able to edit the database

    #21451

    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.

    #21567

    security_man
    Participant

    okay, we are almost there… i have everything figured out except that somehow if i clone a dropdown (select field) it does not show the selected option when i use $form->setValue in a pre_display hook. The html shows the correct option with the “selected” in it, but it does not display. looks like some kind of css3 issue, but i cant figure out how to resolve it?

    #21580

    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 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.