Jump to content


Photo

onchange


  • Please log in to reply
3 replies to this topic

#1 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 03 May 2006 - 07:11 PM

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

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 03 May 2006 - 07:22 PM

[!--quoteo(post=371018:date=May 3 2006, 03:11 PM:name=crouchjay)--][div class=\'quotetop\']QUOTE(crouchjay @ May 3 2006, 03:11 PM) View Post[/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]
<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>


#3 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 03 May 2006 - 09:59 PM

[!--quoteo(post=371026:date=May 3 2006, 09:22 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ May 3 2006, 09:22 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
<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>
[/quote]
Is there a way to do it with out the form since I already have I form? I don't want everything submitted.

#4 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 25 May 2006 - 12:05 AM

Just add the this.value to the url like this

<SELECT "cars" onchange="window.location='cars.php?sort='+this.value">
<OPTION value="ford">ford</OPTION>
<OPTION value="toyota">toyota</OPTION>
</SELECT>

NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users