i’ve a problem with my dropdown database values. When form is loading, no problem, but when i submit then, and if i’ve an errror, my dropdown is empty.
it’s my code
function _retailers_opts($form) { global $wpdb; $drop_down_retailers = $form->getElement(‘iphorm_9_12’); $rows = $wpdb->get_results(“SELECT id, name FROM retailers”); $opts = array(); foreach($rows as $row) $opts[] = array(‘value’ => $row->id, ‘label’ => $row->name); $drop_down_retailers->setOptions($opts); } add_action(‘iphorm_pre_display_9’, ‘_retailers_opts’);