Home › Forums › Quform WordPress › Default option
Hi there,
I was able to populate a dropdown field with values from the database but now I can’t set the default option.
I’m using this code to load the titles of all the posts in a custom post type into the dropdown labels and their IDs into the value:
while ($row = mysqli_fetch_assoc($post_type)) { $options[] = array('label' => utf8_encode($row['post_title']), 'value' => $row['ID']); }
$dropdown = $form->getElement('iphorm_1_5'); if ($dropdown instanceof iPhorm_Element_Select) { $dropdown->setOptions($options); }
Can you help me out?
Thanks in advance!
😉
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
Thanks! Can I find that in the documentation?
Cheers!