Skip Navigation

[Resolved] Select lists in filters – can they display a blank ("please select …") value?

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Simon Logan 4 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1384485

I've set up a filter/search block to allow users to filter the results on a page and a couple of the fields i have are select lists which pull their values from a custom field, however I can't see a way to add a blank/empty option to each of them from the search form?

So at present there is a list, lets call it LISTA, with values VALUEA, VALUEB, VALUEC which can be filtered through, however when the list loads VALUEA, being the first value, is shown as being selected, so when the search form is submitted, this value is being searched on. Is there a way to allow for a blank value such as "Please select ..." or "View all" so that users can make a selection on *another* field but leave that one alone so that it's not filtered at all?

#1384557

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Simon,

Thank you for getting in touch.

All you need to do is to add this attribute to the filter default_label="Please Select" This should give it the default option.

Example.

	[wpv-control-post-taxonomy taxonomy="category" type="select" default_label="Test" url_param="wpv-category"]

Please let me know if this helps.
Thanks,
Shane

#1385813

That's great, thanks for that - is it possible to supply a default value for radio boxes too? Or is that due to their nature I'd need to either switch to using radio boxes for displaying the filters or just use the RESET button instead?

#1385997

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Simon,

No its not possible to have a default value for the radio buttons.

You will need to use the reset button to clear it.

Thanks,
Shane

#1386035

Understood, thanks Shane!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.