crouchjay Posted May 3, 2006 Share Posted May 3, 2006 <SELECT "cars" onchange="window.location='cars.php?sort=value'"><OPTION value="ford">ford</OPTION><OPTION value="toyota">toyota</OPTION></SELECT>I am trying to pass the selected value through. I have tried the search attribute of location, but that was false. I am really stumped. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/8997-onchange/ Share on other sites More sharing options...
lead2gold Posted May 3, 2006 Share Posted May 3, 2006 [!--quoteo(post=371018:date=May 3 2006, 03:11 PM:name=crouchjay)--][div class=\'quotetop\']QUOTE(crouchjay @ May 3 2006, 03:11 PM) [snapback]371018[/snapback][/div][div class=\'quotemain\'][!--quotec--]<SELECT "cars" onchange="window.location='cars.php?sort=value'"><OPTION value="ford">ford</OPTION><OPTION value="toyota">toyota</OPTION></SELECT>I am trying to pass the selected value through. I have tried the search attribute of location, but that was false. I am really stumped. Thanks.[/quote][code]<form name="form" action="cars.php" method="get"><SELECT name="sort" onchange="document.form.submit();"><OPTION value="ford">ford</OPTION><OPTION value="toyota">toyota</OPTION></SELECT></form>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/8997-onchange/#findComment-33078 Share on other sites More sharing options...
crouchjay Posted May 3, 2006 Author Share Posted May 3, 2006 [!--quoteo(post=371026:date=May 3 2006, 09:22 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ May 3 2006, 09:22 PM) [snapback]371026[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]<form name="form" action="cars.php" method="get"><SELECT name="sort" onchange="document.form.submit();"><OPTION value="ford">ford</OPTION><OPTION value="toyota">toyota</OPTION></SELECT></form>[/code][/quote]Is there a way to do it with out the form since I already have I form? I don't want everything submitted. Quote Link to comment https://forums.phpfreaks.com/topic/8997-onchange/#findComment-33138 Share on other sites More sharing options...
nogray Posted May 25, 2006 Share Posted May 25, 2006 Just add the this.value to the url like this[code]<SELECT "cars" onchange="window.location='cars.php?sort='+this.value"><OPTION value="ford">ford</OPTION><OPTION value="toyota">toyota</OPTION></SELECT>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/8997-onchange/#findComment-38740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.