Dynamic dropdown values not showing after submit form with error

Home Forums Quform WordPress Dynamic dropdown values not showing after submit form with error

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7894
    fmay
    Participant

    Hi,

    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’);

    can you help me please ?

    #7920
    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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy