PDA

View Full Version : Selection box with no button req'd


inheritsite
03-02-2004, 10:15 AM
Hello -
Someone here helped me a few weeks ago to create a selection box. Code is as follows:
<form>
<p>Select by Price
<select name="priceselection" size="1">
<option value="upto5.html">Up to $5,000</option>
<option value="4to10.html">$4,000 to $10,000</option>
<option value="9to30.html">$9,000 to $30,000</option>
<option value="25andover.html">$25,000 and Over</option>
</select>
<INPUT TYPE="button" value="GO!" onclick="location.href=this.form.priceselection.options[this.form.priceselection.selectedIndex].value">
</p></FORM>

My Question: Is it possible to redo this such that clicking on a selection would suffice WITHOUT requiring a GO button?

Thanks to anyone for assistance.

GDS
03-02-2004, 11:40 AM
Yes!

use something like <select onchange="go()">

GDS

inheritsite
03-02-2004, 05:35 PM
GDS,
Thanks for your quick input, really appreciate it.

Could you be a little more specific on your suggestion? I've tried several iterations of the select onchange using the above code. It eliminates the GO button because I eliminate the INPUT type, but the selections themselves are not activated when I do so.

Appreciate your help or anyone else who may chip in. I'll keep looking for sites which may have the characteristics I'm looking for with the selection boxes.

Thanks.

azlatin2000
03-02-2004, 05:50 PM
<form>
<p>Select by Price
<select name="priceselection" onchange="location.href=this.options[this.selectedIndex].value">
<option value="upto5.html">Up to $5,000</option>
<option value="4to10.html">$4,000 to $10,000</option>
<option value="9to30.html">$9,000 to $30,000</option>
<option value="25andover.html">$25,000 and Over</option>
</select>
</p></FORM>

inheritsite
03-03-2004, 10:56 AM
Azlatin -
Thank you so much. Come to think of it, you're the one who helped me before.

It did the trick!

Regards.