Navigation überspringen

[Gelöst] Adding a default value to Search Form select menu

This support ticket is created vor 4 years, 2 months. 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.

Dieses Thema enthält 1 reply, hat 2 Stimmen.

Zuletzt aktualisiert von Christopher Amirian vor 4 years, 2 months.

Assistiert von: Christopher Amirian.

Author
Artikel
#2332079

Tell us what you are trying to do?
Add a default "Please Select One" option to the "Expertise" select menu on search form. It would be the default selection and when selected, it would not alter the search.

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
No

What is the link to your site?
versteckter Link

The Edit View page in toolset has the following code:

[wpv-filter-start hide="false"]
[wpv-filter-controls]

<div align="center">
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">Name</div>
<div class="divTableCell">[wpv-filter-search-box class="searchform"]</div>
</div>

<div class="divTableRow">
<div class="divTableCell">Expertise</div>
<div class="divTableCell">[wpv-control-postmeta field="wpcf-areas-of-practice" type="select" url_param="areas-of-practice" style="width: 100%"]</div>
</div>
<div class="divTableRow">
<div class="divTableCell">Office Location</div>
<div class="divTableCell">[wpml-string context="wpv-views"][/wpml-string][wpv-control field="address" url_param="address" type="select" values=",ny,nj,dc" display_values="Select to Search by Location,New York,New Jersey,Washington DC"]</div>
</div>

</div>
</div>

<br />
<div class="shell_input" style="display:inline-block;">[wpv-filter-submit name="Submit" class="searchform" type="input"]</div>
<div class="shell_input" style="display:inline-block;">[wpv-filter-reset name="Reset" class="searchform" type="input"]</div>

</div>

[/wpv-filter-controls]
[wpv-filter-end]
<hr>

#2332937

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi there,

In the code that you shared, please change:

[wpv-control-postmeta field="wpcf-areas-of-practice" type="select" url_param="areas-of-practice" style="width: 100%"]

to:

[wpv-control-postmeta default_label="Please Select One" field="wpcf-areas-of-practice" type="select" url_param="areas-of-practice" style="width: 100%"]

I added the attribute below to have a default value:

default_label="Please Select One"

Thank you.