Jump to content

Archived

This topic is now archived and is closed to further replies.

dharm

dropdown jump menu.. need help!!

Recommended Posts

Hi. I was wondering if anyone could help me with this jump menu.. The jump menu is part of a form that includes other fields which make up a search page. The jump menu works fine but the problem is with the other input text fields.. if for example when I input data in any of the other fields then select a option from the jump menu the page will refresh but the data from the text fields I entered will not appear..

Is there a way where I can save the data from the forms when the jump menu re-loads the page?.. Or is there a better alternative then using an old fashion jump menu ..? 

Here is the code:

[quote]<select name="category" onChange="window.location = this.options[this.selectedIndex].value">
<option value="search.php">Any</option>
<option value="search.php?cats=1">1</option>
<option value="search.php?cats=2">2</option>
</select>[/quote]

Any help will be much appreciated… 

Share this post


Link to post
Share on other sites
Cookies come to mind....

Share this post


Link to post
Share on other sites
Try this: [code]<select name="category" onChange="location.href=this.value">
<option value="search.php">Any</option>
<option value="search.php?cats=1">1</option>
<option value="search.php?cats=2">2</option>
</select>[/code]

Share this post


Link to post
Share on other sites
Just remember that any JS-only solution is limiting... if this is real functionality, use a submit button, as mentioned earlier.

Share this post


Link to post
Share on other sites
In this case I would actually use this: [code]
<form method='get'>
<select name="cats" onChange="form.submit()"> <!-- not sure about this. I can't remember how to submit forms using javascript -->
<option value="">Any</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<button type='submit'>Go</button>
</form>[/code]

This would work without javascript.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.