/    Sign up×
Community /Pin to ProfileBookmark

search form: on result, passing values to the form again?

I have a simple search script, that submits query based on multiple inputs.

The form resides on the same page where php search script (i.e. actions to self).

Is there a way for the form to “remember” the original selection, so it is easy for someome to modify search without re-entering all 15 options?

it seems that I find tons of not-so-relevant info. A pointer toward a good tutorial/source would be appreciated.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@delr2691Aug 16.2006 — it would be simple if they were inputs.. you do just this:
[code=php]
<input name="input1" value="<?php echo $_POST['input1']; ?>">
[/code]


but if you have select inputs you'd want to try something like this:
[code=php]
echo '<select name="select1">';

echo '<option value="option1"';
echo ($_GET['select1'] == "option1") ? " selected>" : ">"; //Now add this to every option
echo '</select>';
[/code]


I think that was what you wanted to do.. Sorry if I didn't understand.. ?
Copy linkTweet thisAlerts:
@DariaauthorAug 16.2006 — Never mind, I will just use the GO BACK javascript function...

It seems to be too complicated: I have multiple inputs with multiple names to do a very narrowed search. If I will have to pass all of them, it will be a lot of hassle, if at all possible, so I will just have the "search again" kind of button with javascript function to go back in history one time, and it will bring you to the browser window with your original selection in place...

Thanks, anyway!
×

Success!

Help @Daria spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...