Dynamic Population of Dropdown with posts

Home Forums Quform WordPress Dynamic Population of Dropdown with posts

This topic is: resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #23914
    MarinusElgaard
    Participant

    Hi Theme Catcher,

    I’m doing a website for a customer that sells travels.
    Every individual travel is a custom post type.

    When a customer wants to book a specific travel they do it through QuForm on a separate page.
    All travels is listed in a dropdown which I put in manually.

    Is it possible to populate the dropdown automatically so everytime a new “travel” is added as a post. It’s automatically added to the QuForm for customers to choose?

    Kind Regards
    A Happy customer

    Attachments:
    You must be logged in to view attached files.
    #23980
    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.

    #23985
    MarinusElgaard
    Participant

    Thanks a lot for the answer. It’s working fine! 🙂

    #30240
    Samurai
    Participant

    Hi,
    I would like to achieve the same, but with optgroup. I presume I would need to create an array like this:
    [
    [‘optgroup_text_that_will_be_displayed’ => [
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’],
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’],
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’]
    ],
    [‘optgroup_text_that_will_be_displayed’ => [
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’],
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’],
    [‘label’ => ‘a text label’, ‘value’ => ‘a text value’]
    ]
    ]

    Could you advise?
    Thanks
    David

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

    #30263
    Samurai
    Participant

    Great! Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy