hi everyone,
this might be very elementary, but i can't seem to find where,
would this be javascript, i think i found a page implementing this but saw no onclick event
for the list element
would anyone mind pointing me in the right direction of this search? thanks
-->
drop down list of countries -
sorry i had to move my post, i just noticed there's a clientside area for this forum, which i did not notice earlier because i always automatically get shifted to the php portion
if i pressed r
the selected item automatically moves to the first item in the list with r as its first letter
thanks
automatically move to first letter of selection on list
Moderator: General Moderators
-
controlxjp
- Forum Newbie
- Posts: 5
- Joined: Fri Jan 25, 2008 5:15 pm
Re: automatically move to first letter of selection on list
I don't think I understand the question. Do you mean something like this?
too add javascript functionality on a selection change, use this:
it will send to the function YourJavaScriptFunction() the "countryname" (in the option tag, not the plain text... ie 'uk' would be sent, not 'united kingdom').
Code: Select all
<select name="option"> <option value="uk">UK</option> <option value="france">France</option> <option value="usa" selected="selected">USA</option> <option value="australia">Australia</option></select>Code: Select all
<select name="option" onchange="YourJavaScriptFunction(this.options[this.selectedIndex].value)"> <option value="uk">United Kingdom</option> <option value="france">France</option> <option value="usa" selected="selected">USA</option> <option value="australia">Australia</option></select>