Jump to content

dropdown jump menu.. need help!!


dharm

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… 
Link to comment
https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/
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.

Archived

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

×
×
  • Create New...

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.