dharm Posted October 5, 2006 Share Posted October 5, 2006 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 More sharing options...
fenway Posted October 5, 2006 Share Posted October 5, 2006 Cookies come to mind.... Link to comment https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/#findComment-104565 Share on other sites More sharing options...
ToonMariner Posted October 5, 2006 Share Posted October 5, 2006 yes don't use the jump menu - make the user hit a submit button. Link to comment https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/#findComment-104681 Share on other sites More sharing options...
Daniel0 Posted October 6, 2006 Share Posted October 6, 2006 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] Link to comment https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/#findComment-104809 Share on other sites More sharing options...
fenway Posted October 6, 2006 Share Posted October 6, 2006 Just remember that any JS-only solution is limiting... if this is real functionality, use a submit button, as mentioned earlier. Link to comment https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/#findComment-104997 Share on other sites More sharing options...
Daniel0 Posted October 6, 2006 Share Posted October 6, 2006 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 https://forums.phpfreaks.com/topic/23109-dropdown-jump-menu-need-help/#findComment-105055 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.