Home All Groups Group Topic Archive Search About

select all multiple-select box

Author
13 Sep 2007 12:00 PM
grangey77
i would like to select all cases in a multiple select box by checking a check
box.

does anyone have any ideas?

thanks

Author
15 Oct 2007 3:14 PM
grangey77
I have managed to create a solution to the problem.

You must call a function from an onclick function (e.g. onclick=
"selectall([name of selectbox])" of a checkbox.  then you need to build a
function much like the one below:

function selectall(chosen)
{
  var selObj = document.getElementById(chosen);
  for (var i = 0; i < selObj.options.length; i++)
  {
    selObj.options[i].selected = true;
  }
}


Show quote
"grangey77" wrote:

> i would like to select all cases in a multiple select box by checking a check
> box.
>
> does anyone have any ideas?
>
> thanks

AddThis Social Bookmark Button