Skip Navigation

[Resolved] Disable'all' option in drop down

This support ticket is created 2 years, 11 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by franzG-4 2 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2272845

Hello,

I have a view (legacy view) with a drop-down filter (front-end) for the selection of an organization, based on passing an url-parameter. I don't want that users can select the 'All' option of the drop down filter. How can I disable this option in drop-down filter, so that it is not displayed to users? I don't want to use another default value, I just want to eliminate this 'All' option.

Kind regards

Franz

Tell us what you are trying to do?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2273737

Hello,

It needs custom codes, for example:
1) you can try to use JS codes to remove the default "All" options from dropdown:
https://stackoverflow.com/questions/12932959/remove-values-from-select-list-based-on-condition

2) and add setup the default filter value for "organization" field with Views filter hook "wpv_filter_query"
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

#2275039

My issue is resolved now. Thank you!