Set Focus on multiple select?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Set Focus on multiple select?

Post by kingconnections »

I have a multiple select box that is dynamicly generated. I have coded it so that you can pass in items to it and the will be selected.
This all works. The problem is that the selected items do not "come to focus" so to speak on the page. If the selected items are not at the top of the list, you would have to scroll down to know that they were selected. I am trying to figure out a solution for this issue. Does any one have any ideas?

TIA!!!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

On multiples through drop downs, it's up to the browser which, if any, are shown in the closed state. The most straight forward way to show them is through a list box so that more than one item is seen at a time.
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post by kingconnections »

Hmm,

What about a java script or something to bring the focus? And this is a select box with the multiple option set.
example:

Code: Select all

<select name="month"> 
<option value="<?php echo $month;?>" SELECTED><?php echo $month;?></option> 
<option value="January">January</option> 
<option value="February">February</option> 
<option value="March">March</option> 
<option value="April">April</option> 
<option value="May">May</option> 
<option value="June">June</option> 
<option value="July">July</option> 
<option value="August">August</option> 
<option value="September">September</option> 
<option value="October">October</option> 
<option value="November">November</option> 
<option value="December">December</option> 
</select>


If I sec December to be selected it would be highlighted in the box, but to see that you would need to scroll all the way down to see it.
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post by kingconnections »

I guess I could do like this example and just place them at the top of the list?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This is a client side issue. Moved to client side.
Post Reply