actually I'm not really sure of *best* way on this one but can help steer you. I've only ever needed to use change() on selects without selecting all.Thre might be better suggesstions like blur or....

if "select all" is first there won't be a change, and it seems IE doesn't like $("option").click() so here goes:

$("#yourSelect".change( function() {
    var selectedValue= $(this).val();
    if (selectedValue== "all") {
        $(this).children("option").attr("selected","selected");// may not need this but it's here if you do
        //do something here if all selected
        }
        ///do something here for values other than "all"
});

<select id="yourSelect">
<option> Select from list</option>
<option value="all">Select All</option>
.........</select>

In this case a little snippet of your select would help ( saves time for somone to have to create some markup to aid your situation), as well as more about what you want to accomplish when you do get "select all"

shaded wrote:
thanks, charlie,

jquery feels like such a puzzle, and i get bits and pieces from
everywhere.

Can we take this to another level?  what if i want to have a first
element in the list, example --select all--,  how do i set it so when
this is selected, all values get selected.


On Jun 23, 11:55 am, Charlie <charlie...@gmail.com> wrote:
  
$("#yourSelect option").attr("selected","selected");shadedwrote:is there a way to select all values of a multiple select list by default?
    

  

Reply via email to