Selecting nothing in a dropdown

This topic contains 7 replies, has 3 voices, and was last updated by  Alex Rollin 6 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #425094

    Conrad Murray
    Buyer
    Post count: 28

    What is the correct syntax for option values to create a dropdown custom field where the first entry is selected the field does not appear on the page but if the other selections are made they do?

    I want the following in the dropdown but I cannot seem to get my head around the correct syntax to achieve it.

    Not a Caterer – want nothing to show, not even the label
    Caterer Available for Private Hire – shows when selected
    Caterer Not Available for Private Hire – shows when selected.

    It doesn’t seem to be detailed how to do it in the documentation.

    #425121

    Kor
    Moderator
    Post count: 16516

    Hi Conrad Murray,

    Thanks for your post. Do you have an example to show us? Perhaps a link?

    Thanks!

    #425169

    Conrad Murray
    Buyer
    Post count: 28

    You can see the dropdownn here:

    https://goodlocalevents.com/add-a-listing/list-a-stallholder/?listing_type=gd_trader

    Selecting “Not a caterer” should mean nothing should show. Selecting “Caterer for Private functions” should show in detail sidebar. Selecting “Caterer does not do Private Functions” should also show that instead in detail sidebar.

    It looks how I want it to but it does not deliver what I want.

    The syntax I used for the above in option values is

    Not a Caterer/0,Caterer for Private Functions/1,Caterer does not do Private Functions/1,

    But it does not work. The yes/no works for “not a caterer” but selecting one or other of the other two do not deliver the option on the page (and do not hold on saving).

    #425176

    Kor
    Moderator
    Post count: 16516

    Hi Conrad,

    Thanks for your reply. Just checked the link you’ve shared and I still need a little bit of clarification on this issue below. Could you list the steps to replicate it?

    But it does not work. The yes/no works for “not a caterer” but selecting one or other of the other two do not deliver the option on the page (and do not hold on saving).

    Thanks!

    #425184

    Conrad Murray
    Buyer
    Post count: 28
    This reply has been marked as private.
    #425255

    Alex Rollin
    Moderator
    Post count: 27815

    Let me restate your initial request.

    A custom select field that, when selection A is chosen, the field is not shown. When B is chosen, the field shows.

    It is not possible without customization to ‘hide a field’ based on the value that the user selected.

    However, it is possible to set the actual value to blank, but this will only get you halfway.

    Here’s an example with cats:

    You can specify the option name and value with a slash, to to add a blank option you can do this

    Select an animal/,cat,dog,rabbit

    Like wise you can do things like this

    Select an animal/,I love Cats!/cat,I love dogs!/dog,I love rabbits!/rabbit

    The select visual option will be “I love cats!” but the actual value submitted will be “cats”

    #425320

    Conrad Murray
    Buyer
    Post count: 28

    Hi Alex, thanks – that seems to work quite well for us.

    Issue resolved.

    #425337

    Alex Rollin
    Moderator
    Post count: 27815

    Glad you got it working!

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket