In article <Po*******************@fe2.news.blueyonder.co.uk >,
no_email@no_email.com enlightened us with...
Hi
I have a dropdown box containing about 10 values.
I would like to create a separate href on my page that when clicked will
make the drop down box go to a specific value. I do not want to have to
refresh the page to do this. Is it possible to have that sort of control
over a drop down box. ?
Yes, but using an href would be a bad idea for an internet application. I'd
use a button, myself, styled to look like a text link if such was the
requirement.
If you decide to use an anchor, it would be
<a href="someNoJSPage.html" onClick="choose();return false;">link</a>
function choose()
{
// change the names and selectedIndex appropriately
// both versions supplied for cross-browser
document.forms["myformname"].elements["myselect"].selectedIndex = 2;
document.forms["myformname"].elements["myselect"].options[2].selected =
true;
}
You can change that to accept a number param or whatever.
--
--
~kaeli~
Join the Army, meet interesting people, kill them.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace