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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.