selectAll()
selectAllExceptFirst()
<item name="Checkbox" colspan="1" rowcontinue="f"> <label>Checkbox <checkbox> <option value="All" label="All"/> <option value="City" label="City"/> <option value="State" label="State"/> <option value="County" label="County"/> <option value="Country" label="Country"/> </checkbox></item>
IWEventRegistry.addItemHandler("/Checkbox","onItemChange",validateCheckbox);
var allSelected = false;
//////////////////////////////////////////////////////////////////////// Function: validateCheckbox// Description: If the user selected the first checkbox, unselect all// other checkboxes. If the user selected any other// checkbox, make sure the first checkbox is unselected.// Parameters:// itemObject - An IWItem object of type checkbox.//////////////////////////////////////////////////////////////////////function validateCheckbox(itemObject){ if (itemObject.getType == "checkbox"); { var itemOptions = itemObject.getOptions(); if (allSelected && itemOptions[0].selected) { itemOptions[0].selected = false; itemObject.setOptions(itemOptions); } else if (allSelected && !itemOptions[0].selected) { allSelected = false; } else if (!allSelected && itemOptions[0].selected) { itemObject.setValue([0]); allSelected = true; } }}