Forum Moderators: phranque

Message Too Old, No Replies

List Box Selections

List box selected item to be displayed even if it lies lower in the list.

         

sash

5:40 am on Sep 28, 2005 (gmt 0)

10+ Year Member



I have a multiple selection List box. i wanted to view the selected item(s) to be displayed even if it lies lower in the list.

<form name="form1" method="post" action="">
<select name="select" size="5" multiple>
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
<option value="4">d</option>
<option value="5">e</option>
<option value="6">f</option>
<option value="7" selected>g</option>
<option value="8" selected>h</option>
</select>
</form>

in the above, the options 7 & 8 are defined as selected but as i view it on IE, i have to scroll down the list box to view the selected items.

is there any way to view the lower selected items on the page load without having scroll down.

benihana

10:53 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I *believe* the only way is to have those items at the top of the list in your source.

Someone may have a better idea though.

<added> ooh. 1000 posts :)</added>

sash

11:16 am on Sep 29, 2005 (gmt 0)

10+ Year Member



no benihana, actually the list items are coming from the database directly.

benihana

11:19 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SO when you pull them out the database - put the selected options at the top of the list in your source code.

That way, you will be able to see them without scrolling, and, correct me if im wrong, thats what you asked for.

sash

12:28 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



no actually its a kind of option for the user to choose as many as they can just like we select hobbies at the time of registration. so seleted items will be vary from user to user. users can be countless.