Home › Forums › Quform WordPress › Select options id are not unique
- This topic has 4 replies, 2 voices, and was last updated 5 years, 11 months ago by Antongu.
- AuthorPosts
- April 11, 2018 at 4:07 pm #24948AntonguParticipant
Hi,
I found the code below in the forum that I using to import the taxonomies into the live select element:function my_pre_display($form) { $options = array(); $terms = get_terms(array('taxonomy' => 'ad_locations', 'orderby' => 'none', 'fields' => 'all')); foreach ($terms as $term) { $options[] = array( 'label' => ($term->parent ? ' — ' : '').$term->name, 'value' => $term->slug ); } $checkboxes = $form->getElement('quform_3_71'); $checkboxes->setOptions($options); } add_action('quform_pre_display_3', 'my_pre_display');
everything works fine, but the id’s of all the option elements are same, what cause the issue – when you click on any label, it checks the first checkbox (because all the id’s are same).
Do you know how to solve it?
Thanks
Anton- This topic was modified 5 years, 11 months ago by Antongu.
Attachments:
You must be logged in to view attached files.April 13, 2018 at 5:30 pm #24982AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 14, 2018 at 7:35 am #24993AntonguParticipantThanks, that solved it!
maybe you know why the first item is not appearing under it’s parent? (the second item is it’s parent)
It should be something about ordering but everything I tried didn’t work.April 16, 2018 at 9:42 pm #25025AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 17, 2018 at 2:14 pm #25057AntonguParticipantThank you very much, I will try it.
- AuthorPosts
- You must be logged in to reply to this topic.