Tell us what you are trying to do?
I need to be able to have a visitor select one of two search boxes - then depending on that selection - a set of. CPT's are shown and the second set of criteria is shown.
So the visitor would choose single or choose couples - Above the list
and then another list to choose from shows on the side of the list returned -
How can I make this possible
Is there any documentation that you are following?
no
Is there a similar example that we can see?
no I have not been able to find one
At this point, I'm not sure exactly which view or page are you referring to, but the first step would be to set the search form with all the fields ( regardless of the fact that they should appear for "single" or "couples" choice ).
Once this search form is working, the next step would to group or structure those fields in a way that they are in special div containers that can be hidden or shown, based on the "single" or "couples" field selection through, some custom script.
Here is how the structure of fields will look like in the "Search and Pagination" section:
<!-- Section for the common fields -->
Common fields which should show always will appear here
<!-- Section for the single option fields -->
<div id="single-fields-container">
Fields which should show only when the "single" option is selected will appear here
</div>
<!-- Section for the couples option fields -->
<div id="couples-fields-container">
Fields which should show only when the "couples" option is selected will appear here
</div>
Once this search form is ready in this structure, please share the link to its page and I'll share an example of a custom script that can be used to show/hide fields.
Okay,
The view that I am working on is the Coach Search View
I have the fields input as you requested.
I am attaching a screenshot to show what they are actually wanting.
The resulting url is: hidden link
2. Next, include a class name "wpcf-coaching-focus" in the div that wraps the "Coaching Focus" search field, so that the checkboxes inside can be easily targeted through a custom script:
( screenshot: hidden link )
<div class="form-group wpcf-coaching-focus">
3. In the "JS editor" tab below the search fields, you can include a script that hides those special fields containers and only show them, when the respective checkbox is checked.
( screenshot: hidden link )
4. The last step would be to include the function name from that custom script "searchFilterHideFunction", in the "will run after updating the results" field, in the "Custom Search Settings" section.
( screenshot: hidden link )
This will make sure that the same custom script is also executed, every time the search results update, due to a change in any search filter.
I hope this helps and please let me know if you need any further assistance around this.
Thank you SO much for helping me - I feel like we are almost there!
I duplicated the setup - so as to not mess with the one that is default for now.
The new page is hidden link
and the new view is coachsearchTestEnter
The script does hide the other categories - however, once I select single or couple then the appropriate new select options become available for a split second - and then disappear. So something is still a little off.
Here is a link to how it is functioning now hidden link
There are a couple of other little things that I need to change as well - hoping you can help me with these - as they are probably simple. I included an image to show the other two things I need.
AND - how do you put spaces between the check boxes and the labels
I've noticed that on the search page ( hidden link ), you've already implemented an elegant solution of using two separate views for "singles" and "couples", which are hidden/shown, through some custom script.
It seems to work great and looks like you've managed to take care of all the items from your last message - well done.
Again my sincere apologies for the long waiting time and please let me know if you have any follow up questions.
For a new or different question/concern, you're welcome to start a new ticket.
regards,
Waqar
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.