Skip Navigation

[Resolved] click submit – show query results separate page

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

This topic contains 20 replies, has 3 voices.

Last updated by davidm-13 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1838197

Tell us what you are trying to do?
Where to locate "Search" and "Reset" buttons. After clicking Search button show results on separate page
Is there any documentation that you are following?
https://toolset.com/2020/03/helping-visitors-find-what-they-need-using-custom-searches/ - specifically in the comments

Hi, David! Sure, here are the steps for the old Views interface:
1. Edit the View in question and go to the Custom Search Settings section.
2. There, select the Let me choose individual settings manually option and look in the section Which options to display in the form inputs.
3. Make sure to select the Show only available options for each input option.
Is there a similar example that we can see?

This is my view:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
    <div class="slct">  
	<label class="r-label" for="wpv-complaint-use">Complaint / Use:</label>
	[wpv-control-post-taxonomy taxonomy="complaint-use" type="select" default_label="Select Complaint/Use" url_param="wpv-complaint-use"]
  </div>
      <div class="slct">  
	<label class="r-label" for="wpv-system">Biological System / State:</label>
	[wpv-control-post-taxonomy taxonomy="system" type="select" default_label="Select Biological System" url_param="wpv-system"]
  </div>
      <div class="slct">  
  <label class="r-label" for="wpv-action-medicinal">Herbal Action:</label>
	[wpv-control-post-taxonomy taxonomy="action-medicinal" type="select" default_label="Select Medicinal Action" url_param="wpv-action-medicinal"]
  </div>
</div>
[wpv-filter-end]
[wpv-filter-submit output="bootstrap" class="btn-secondary"]
[wpv-filter-reset output="bootstrap"]

Submit/Search button does not do anything - like to see results with te selected taxonomies on a separate page.
Thanks for any help

#1838615

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You want to have the search form on one page and the search results on another, is that the issue?

In that case you need to insert the same View twice.

On the first page—for the search form—use the Fields and Views button to insert the View, and the dialog will ask what to include, and you'll want to choose the just the search form, specifying the page where the results will be shown.

On this second page you insert the View a second time, only on this page you'll specify that you are inserting the results.

It can be easier to do this in reverse order so you already have the results page prepared that you'll need to specify in the first step.

#1838885

Hi Nigel, thanks for your reply.
Not clear how to "insert the same View twice."
The View also includes the 3 taxonomy dropdown lists that I want to query - so how does the view know to act differently depending if it's on the query form or the results page - what am I missing?
Thanks

#1839069

Hi I understand the results page needs to be marked results only - I'm working in the old classic style, without Gutenberg blocks and can't find where to specify this.

Thanks

#1839147

Where do I place the Submit and Reset buttons?
I have this at the end of the Search and Pagination section

[wpv-filter-end]
[wpv-filter-submit output="bootstrap" class="btn-secondary"]
[wpv-filter-reset output="bootstrap"]

but no buttons appear on the search form?

#1839221

Shane
Supporter

Languages: English (English )

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

Hi David,

As Nigel explained when inserting the view using the Fields and Views button you will be presented with the options
- Insert Search only.
- Insert Results only.
- Insert both search and results.

In your case you need to go to the page where you have the search and re-insert the view, only this time you are going to select "Results Only" when you are inserting the view.

Please let me know if this is a little clearer.

Thanks,
Shane

#1839331

Hi Shane, thanks for your reply.
I've got as far as inserting the View for Search form and Results on two separate pages.
Now I'm having the problem I described in my last post - the search and reset buttons are not appearing in the search form section so I have no way to test my setup. Any ideas?

Thanks

#1839475

Making slow progress.
This is my View template:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
    <div class="slct">  
	<label class="r-label" for="wpv-complaint-use">Complaint / Use:</label>
	[wpv-control-post-taxonomy taxonomy="complaint-use" type="select" default_label="Select Complaint/Use" url_param="wpv-complaint-use"]
  </div>
      <div class="slct">  
	<label class="r-label" for="wpv-system">Biological System / State:</label>
	[wpv-control-post-taxonomy taxonomy="system" type="select" default_label="Select Biological System" url_param="wpv-system"]
  </div>
      <div class="slct">  
  <label class="r-label" for="wpv-action-medicinal">Herbal Action:</label>
	[wpv-control-post-taxonomy taxonomy="action-medicinal" type="select" default_label="Select Medicinal Action" url_param="wpv-action-medicinal"]
  </div>
</div>
[wpv-filter-submit name="SEARCH" type="button" class="submitBtn"]
[wpv-filter-reset reset_label="RESET" type="button" class="resetBtn"][/wpv-filter-controls]
[wpv-filter-end]

And the shortcode to display only the search form is:

[wpv-form-view name="search-by-complaint" target_id="self"]

Problem now is that when I click "SEARCH" the results page appears for an instance, then closes.
What could be causing this?

#1839997

Shane
Supporter

Languages: English (English )

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

Hi David,

Would you min providing me with admin access to the site so that I can have a look at the setup through the backend?

I've enabled the private fields for your next response, also please send me a link to the page where I can see the search form and results page.

Thanks,
Shane

#1840409

Shane
Supporter

Languages: English (English )

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

Screenshot 2020-11-10 at 2.20.15 PM.png
Screenshot 2020-11-10 at 2.20.24 PM.png

Hi David,

From what I can see this search won't produce any results. There are quite a few issues.

1. Your search view Query filters do not match up with the frontend filters. I would suggest deleting these 2 sections from your view. See Screenshots

2. Using the New Filter button re-add the filters so that the correct linkage can be made between the frontend and the backend query filters.

3. I notice that your search form shortcode is set to target the page that it is one [wpv-form-view name="search-by-complaint" target_id="self"]

This won't work if the search results are on another page. Ideally you would want the results to be on another page. To resolve this you will need to replace "self" with the ID of the page that the results are on.

4. " - would also like to limit these list to 10 items with overflow scroll" In order to do this you will need to enable Pagination for you view an enable the infinite scroll option. This can be found under "Pagination enabled with manual transition and AJAX".

Please let me know if this helps.
Thanks,
Shane

#1843739

Hi Shane,
I've done as you suggested. Now I'm seeing the results and they look correct.
The problem now is the 3 dropdown select lists of taxonomies on the Search form (hidden link), Complaints, Systems and Herbal Actions are behaving strangely, the first list I open to select an item appears ok but the second and third list I open there's only 3 items instead of all the items in the taxonomy - can you check it and tell me what I'm doing wrong.

In item 4 of your answer above I think you misunderstood me - when I say limit lists to 10 items I'm talking about the dropdown select lists in the search form, if I was writing HTML it would appear as <select size="10"> but not sure how to do this in the Search and Pagination section of the view.
Thanks for your help

#1843787

Shane
Supporter

Languages: English (English )

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

Screenshot 2020-11-13 at 1.06.28 PM.png

Hi David,

This occurs because you have this setting enabled on your view "Show only available options for each input". See Screenshot

What this does is that it only gives you the options that will allow the view to always present a result.

If you want all the filters to show regardless you will need to use the option "Always show all values for inputs".

Thanks,
Shane

#1843843

Shane,
Thanks very much for sorting all this out, much appreciated.
One last thing, can I control the number of items that appear in the dropdown lists on the search form?
In HTML I would write <select size="10"> , how do I do that in the Views shortcode?

Thanks

#1846139

Shane
Supporter

Languages: English (English )

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

Hi David,

You can try using jQuery to add the attribute.

jQuery( ".some-class" ).attr( "size", "10" );

Where you will replace "some-class" with class of the select tag.

Thanks,
Shane

#1846317
select-size..jpg

Hi Shane, almost there.
I've inserted the class as below

	[wpv-control-post-taxonomy taxonomy="action-medicinal" class="some-class" type="select" default_label="Select Medicinal Action" url_param="wpv-action-medicinal"]

Which gives attached image when opening the page with class applied only to Herbal Action - I want to activate the size limit only when clicking the dropdown arrow.
Thanks for your help.