View Full Version : how to make Combo Box list options NOT display

12-11-2007, 11:54 AM
i would like to make some of the combo box list options NOT appear ..

<SELECT NAME="cbo_opr" >
<OPTION value="001" style="display:none">All</OPTION>
<OPTION value="002">Any</OPTION>

i'd added " style="display:none" " in options 001. When view in IE 7, still be able to see the Option 001. But in other browser like Mozilla Firefox is work fine..

anybody know what's the root cause & solution for these? Cos i need my web site need to be view via IE 7 browser..

Pls help .. Many thanks ..

12-11-2007, 12:08 PM
If this is a static page, I'd prefer not to write those options.
If this is a dynamic page I'd prefer to use server-side if() conditions to filter them.

12-11-2007, 04:56 PM
Or comment them out.

12-12-2007, 02:26 AM
actually i have 2 combo in the html .. combo 1 & combo 2 .. combo 2 display options list depends on combo 1 selection.
followings are my codings ..

function goLoadExpr(fldVal,exprObj){
var fldDatTyp= fldVal.substring(fldVal.indexOf("_")+1,fldVal.length;

var cboExprlength = document.forms[0].exprObj.length;
var exprVal;
var exprDatTyp;
for(var i=0;i<cboExprlength;i++){
exprVal = exprObj.options[i].value
exprDatTyp = exprVal.substring(exprVal.indexOf("_")+1,exprVal.length;
if (fldVal == exprVal){
exprObj.options[i].style.display = '';
exprObj.options[i].style.display = 'none';

<SELECT NAME="cbo_fld" onchange='goLoadExpr(this.value,document.forms[0].cbo_expr);'>
<OPTION value="001_decimal">AMOUNT</OPTION>
<OPTION value="002_char">NAME</OPTION>

<SELECT NAME="cbo_expr" >
<OPTION value="001_decimal" style="display:none">in..between..</OPTION>
<OPTION value="002_decimal" style="display:none">greater than</OPTION>
<OPTION value="003_char" style="display:none">start with</OPTION>
<OPTION value="004_char" style="display:none">end with</OPTION>