tested in IE and FF
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
/*
* This method selects all the items in the list if "All" (index position 0)
* is selected
*/
function selectAll(){
var combo = document.getElementById('item');
var val1 = combo.options[combo.selectedIndex].value;
alert("If this alert is present it works in IE");
for( var i = 0; i < combo.options.length; i++ ) {
if(val1 == '0'){
combo.options[i].selected = true;
}
}
}
/*]]>*/
</script></head>
<body>
<select list="elements" name="item" headerKey="0" headerValue="ALL"
multiple="true" size="4" id="item" onclick="selectAll();">
<option value="0" >11111111</option>
<option value="1" >11111111</option>
<option value="2" >11111111</option>
<option value="3" >11111111</option>
</select>
</body>
</html>
Bookmarks