Forums › Forums › Search & Filter Pro › Pass the search value between forms/results
Tagged: multiple forms, Pass values, User experience, V3
- This topic has 20 replies, 2 voices, and was last updated 4 years, 7 months ago by
Anonymous.
-
Anonymous(Private) November 13, 2020 at 1:56 pm #266379
Also one difficulty one might encounter if using the same form is that on the basic search I only want to display the 5 more relevant result (all set nicely with relevanssi, nice integration by the way) while on the advanced search I want every result.
An other advantage to have two diferrent form is that the first form may search in page and post, while the advanced search on other post-type for instance ๐
cheers
Anonymous(Private) November 13, 2020 at 2:05 pm #266383Hi,
haven’t seen your reply…
two things,
– I don’t know if I should only built one form or two (at the moment I only have one)
– the site I’m working on is under construction, with no public access yet, I may create you an account if you really needbut if you could explain me the porces to set this up it might be easier ๐
Thank’s
Anonymous(Private) November 13, 2020 at 2:07 pm #266385Haha again our post passed in the ether
Sorry about that
yes exactly, I want the user to be able to do a search and display the resut on the basic page, where he is also inviter to doan advanced search.
But I wouldn’t be nice in term of user experience to simply send him to a different page, the idea is to get the search he did on the basic page, and use it on the advanced page when he land here ๐
Trevor(Private) November 13, 2020 at 2:23 pm #266388The second option, where the search on the origin page always goes to the results page, is easy.
Have two forms. For this example, I will assume some basic design:
#1 On the origin page. Have just a Text search field. Display Results Method set to Custom, URL set to the Advanced Search Results Page, AJAX off.
#2 On the Advanced Search Results Page. Has a Text Search field and other fields. This form set as you wish.
The search text from the origin page and form 1 will pass to form 2.
Anonymous(Private) November 13, 2020 at 2:39 pm #266396Hi again ๐
Ok, that’s a cool way to pass the data, we are getting closed but not quite there yet.
The idea is to display some “basic” result on the basic search page, in ajax, and add a link or button at then end of the results template (out of the loop) to go to the advance search. The user may or may not go to the advanced search, he do not have to, but may, and if so, instead of a simple link to the advanced search page, the data is passed to the advanced form/results (and if it is not the same form the result may be different) ๐
let’s say
Basic form
only text search
only 5 result, no pagination
only post-type pageAdvanced form
Several search field including text search
unlimited result paginated
any post-typethe idea is to be able to do a basic search, and extend it to the advanced one, without having to resubmit the value entered on the basic search
(this is important since the basic search will actually have 2 to 4 field, while the advanced one 5, and broaden categories and post-types)
This is what I would really like to achieve?
—
possible solutionCan we get the form field value into the result template ?
then we could generate a html link with php var values
$formfield1 = get_S&F_field_1_Value
$formfield2 = get_S&F_field_2_Value“&field2=<?php echo $formfield2 ?>” />
or something like this ?
Trevor(Private) November 13, 2020 at 3:03 pm #266406Try making three forms?
The third form identical to form 2, but set to Custom no Ajax and pointing to the other page.
Then, modify form 1 to be a normal form with results on that origin page.
On the origin page, also have form 3. Don’t worry that it is visible for now, this is just a test.
Then, when you do a search, do the fields in forms 1 and 2 set themselves the same?
Anonymous(Private) November 13, 2020 at 3:52 pm #266411Hi
before digging into this let me ask a question
should I have
Basic form
Advanced 1
Advanced 2Or
Basic 1
Basic 2
Advnaced— I assumed one basic and two advances
so I enter the data in the basic and advanced 1, and on submit of advanced 1 it goes to custom wich is actually advanced 2right
-
AuthorPosts