• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make the first item of dropdown listbox tobe auto selected always  RSS feed

 
preshen dasane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a empty drop down listbox.when i click a button it is auto filled.but none of filled items are selected.But i want firstitem of it to be auto selected at the same moment when i click the same button to fill the list box.Should i change a listbox property or should i add a additional javascript for that button.If so what is it?Please help me.
Further i want to hide this list box from the screen.Can i do this also?

Here are codes.

Code for list box:



select name="sourceId" style="width:150" onChange="JavaScript:drawMap()" class="dropDwn"



/select
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"G. Newer Come", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!