Dear Sir/Madam,
I make my own custom search as below
custom search
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div id="filter-controls">
<div class="col-xs-12 col-md-4">
<div class="form-group">
[wpv-control-postmeta field="wpcf-district" type="select" source="custom" url_param="wpv-wpcf-district" values="[wpv-view name="options-district-key"]" display_values="[wpv-view name="options-district"]" default_label="Please select District"]
</div>
</div>
<div class="col-xs-12 col-md-4">
<div class="form-group">
[wpv-control-postmeta field="wpcf-estate" type="select" source="custom" url_param="wpv-wpcf-estate" values="[wpv-view name="options-estate-key"]" display_values="[wpv-view name="options-estate"]" default_label="Please select Estate"]
</div>
</div>
<div class="col-xs-12 col-md-4">
<div class="form-group">
[wpv-filter-submit name="搜尋" output="bootstrap" class="custom-search-btn"]
</div>
</div>
</div>
</div>[/wpv-filter-controls]
[wpv-filter-end]
The above custom search will be called by
[wpv-form-view name="custom-search" target_id="597"]
I got the search result but I cannot pass the url parameter to this custom search fields, how can I do that?
Best regards,
Kelvin.
Dear Kelvin,
You can get the URL with parameters simply, like this:
Goto the front-end page, in the custom search form, choose an option in search fields, click submit button, you will be able to see the URL of your browser is changed, the parameters are in that URL, you can use them directly, for example:
hidden link
Dear Luo Yang,
I separate the search form and result in two pages, the result page includes the form also, when I select the option from the search form and press submit, I find the options do pass to the URL but the cannot correctly keep the option value to the form in result page, I find it is caused by my other ticket,
https://toolset.com/forums/topic/trim-out-all-the-space-from-the-first-and-last-options-in-custom-search/
If you can, please help to follow up the ticket also.
Best regards,
Kelvin.
Please share your website credentials and the problem URLs in below private message box, thanks
Thanks for the details, I think you are passing wrong URL parameters:
You should pass URL parameter values in English, same as your HTML options value, for example:
hidden link
You can get those values by this:
hidden link
choose some options in the search form, click search button
Dear Luo Yang,
Please visit hidden link, from the inspector, you can find the first and last options contain a lot of space, when you select the first option 利豐大廈, although the result can be queried on the result page, you should find the first option is not selected in the selection field. The URL of the search is
<em><u>hidden link</u></em>
The parameter wpv-wpcf-estate contains the space.
If you select the 地區 as 南丫島 and search, you can still find the 南丫島 keeping in the field.
This is the result caused by the View rendering, will you follow up the ticket https://toolset.com/forums/topic/trim-out-all-the-space-from-the-first-and-last-options-in-custom-search/ ?
Best regards,
Kelvin.