...

View Full Version : drop down box..



benni
02-24-2005, 09:11 PM
Hello,

I need to put the following link into a drop down box, so when the item is selected in the box it the link is called and the page is opened.

<a href="qxl.php?action=sort_price&query='.$query.'&price=ASC">

Pls could someone show me how i would do this ???

Thxs. :cool:

_Aerospace_Eng_
02-24-2005, 09:39 PM
try this

<select onchange="window.open(this.options[this.selectedIndex].value);">
<option value="" selected>Select an Option</option>
<option value="qxl.php?action=sort_price&query='.$query.'&price=ASC">Option 1</option>
</select>

benni
02-24-2005, 09:45 PM
That works a treat,

But how do i open the link in the same window, rather than opening a new window ????

Thxs. :)

_Aerospace_Eng_
02-24-2005, 10:04 PM
like this

<select onchange="window.location=this.options[this.selectedIndex].value;">
<option value="" selected>Select an Option</option>
<option value="qxl.php?action=sort_price&query='.$query.'&price=ASC">Option 1</option>
</select>

codegoboom
02-25-2005, 02:21 AM
BTW, this little blurb (http://www.webaim.org/techniques/forms/4#javascript) about accessible forms might be worth noting.

Actually, that's not entirely true--as I recall, the control can be dropped up/down with a key sequence (but this may be a system dependent setting). :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum