Problem:
How to add a value for the search dropdown default item instead of the blank label?
Solution:
Add the Javascript code below to the view:
function setDropdownDefaultValue() {
jQuery('select[name="wpv-category"] > option:first-child').text('LABEL');
}
jQuery(document).ready(function() {
setDropdownDefaultValue();
});
jQuery(document).ajaxComplete(function() {
setDropdownDefaultValue();
});
replace LABEL with the label you want to add.
Relevant Documentation:
https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/
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.
This topic contains 4 replies, has 2 voices.
Last updated by 3 years, 10 months ago.
Assisted by: Christopher Amirian.