for (var i=0; i#obj.options.length; i++){ obj.options.selected = true;}
kaalraa,I had problems with that earlier today -- instead, you might want to attach your JS. I personally hate DevNet's inability to effectively embed a chunk of code in a page.Dave
Actually, there is a way to control the selection of multiselect boxes and I recommend it. Checkboxes can be a pain to work with...If you wanted to set the selected values of a multiselect (let's say your multiselect consisted of integers between 1 and 5, inclusive), you would do the following:IWDatacapture.getItem('/someMultiSelect').setValue(1,2,3,4,5);You MAY need a single quote around the 1,2,3,4,5 but I think that's right. The line above would select all referenced values -- I'm using it myself for a heirarchical multi-select where if someone selects a parent item, the selection cascades to its descendants.
I don't doubt that there are more efficient ways to do this but that seems to work. Dave
// Get your combo objectvar cmb = ....// Select Allvar cmb_options = cmb.getOptions(); if (cmb_options != null) { for (var i=0; i<cmb_options.length; i++) { cmb_options.selected = true; } cmb.setOptions(cmb_options);}
I would recommend placing a button next to the multi select and add an onCallout event handler. Here is a generic function that will select all items for the item object passed in. Simply call this function onCallout and it will select all options.
function selectAll(itemObject){ if (itemObject.isMultiSelect()) { var optionsArray = itemObject.getOptions(); for (var i=0; i<optionsArray.length; i++) { optionsArray.selected = true; } itemObject.setOptions(optionsArray); } else { return false; } return true;}//function selectAll()