Home › Forums › Quform WordPress › Duplicate Single Text Field
- This topic has 9 replies, 3 voices, and was last updated 6 years, 7 months ago by Ally.
- AuthorPosts
- December 15, 2016 at 6:16 pm #20528mbakerParticipant
Hello,
I found this article that helped me enable duplicating a text field. (https://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!
December 16, 2016 at 12:56 pm #20537AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
December 16, 2016 at 6:44 pm #20538mbakerParticipantThank 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
December 19, 2016 at 3:51 pm #20547AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 24, 2017 at 9:57 pm #21429security_manParticipanthow 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.
June 24, 2017 at 10:14 pm #21430security_manParticipantwell, 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);
June 24, 2017 at 10:30 pm #21431security_manParticipantone 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
July 1, 2017 at 8:52 am #21451AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 1, 2017 at 9:40 pm #21567security_manParticipantokay, 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?
August 6, 2017 at 9:30 pm #21580AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.