Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to make Combo Box list options NOT display

    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>
    </SELECT>

    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 ..

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,802
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    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.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Or comment them out.

  • #4
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 = '';
    }else{
    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>


    <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>
    </SELECT>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •