Default option

Home Forums Quform WordPress Default option

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12303
    Streetdog
    Participant

    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!

    😉

    #12312
    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.

    #12329
    Streetdog
    Participant

    Thanks!
    Can I find that in the documentation?

    Cheers!

    #12343
    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 4 posts - 1 through 4 (of 4 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