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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I do this with layers?

    I have 5 check boxes for different database names. Each database will have different types of drop downs. So if a user checks db1 then I want to show a language, document type, date dropdowns. If a user checks on db2 checkbox then I want to show a language, treatment type, discipline, date dropdowns. If the user clicks on db3 check box then I want to show only language and date dropdowns.

    Then it gets more complicated. If a user clicks on both db1 and db2 then I want to show only those dropdowns that are common to those databases. Same thing if they check all three databases. This goes on up to 5 different check boxes for databases.

    I have to do this only with the client side programming. No server side request. So can this be done with layers? Any ideas or other URLS I can look at or combination of layers and Javascripts?

    Here is the html: It is only partial html from my big page. So it might not contain all the proper tr, td tags in order

    <form name="search">
    <table border="0" cellspacing="0" cellpadding="0" width="600" bgcolor="#C3C8D1">
    <tr><td valign="top" height="20" colspan="4"><img src="images/spacer.gif" border="0" height="20"></td></tr>
    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" colspan="3" bgcolor="#C3C8D1"><a CLASS="SmBlueTableText"><b>SELECT DATABASE</b></a></td>
    </tr>
    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td width="550" valign="top" colspan="2" bgcolor="#C3C8D1">
    <table border="0" width="550" cellspacing="0" cellpadding="0">
    <tr><td valign="top" width="100"><input type="checkbox" name="all"><a CLASS="SmBlackText"> All</a></td><td valign="top" width="115"><input type="checkbox" name="cpx"><a CLASS="SmBlackText"> Compendex</a></td><td valign="top" width="85"><input type="checkbox" name="insp"><a CLASS="SmBlackText">Inspec</a></td><td valign="top" width="100"><input type="checkbox" name="ntis"><a CLASS="SmBlackText">NTIS</a></td><td valign="top" width="250"><input type="checkbox" name="patent" checked><a CLASS="SmBlackText">Patents </a><a CLASS="ExSmBlackText">(European only)</a>&nbsp; <img src="images/blue_help1.gif" border="0"></td></tr>
    </table>
    </td>
    </tr>

    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" colspan="3">
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
    <td valign="top" colspan="2" bgcolor="#C3C8D1"><A CLASS="SmBlueTableText"><B>LIMIT BY</b></a></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="SmBlueTableText"><B>SORT BY</b></a></td>
    </tr>

    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="MedBlackText">
    <select name="doctype">
    <OPTION VALUE="all">document type1</OPTION>
    <OPTION VALUE="bookchapter">Document type2</OPTION>
    <OPTION VALUE="journalpaper">Docuemnt type3</OPTION>
    </SELECT></a> <img src="images/blue_help1.gif" border="0"></td>
    <td valign="top" bgcolor="#C3C8D1">
    &nbsp; <A CLASS="SmBlackText"><input type="radio" name="sort" value="Relevance" checked>Relevance
    &nbsp; <input type="radio" name="sort" value="date">Publication year</a></td>
    </tr>

    <tr><td valign="top" colspan="3" height="4"><img src="images/spacer.gif" border="0" height="4"></td></tr>
    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="MedBlackText">
    <select name="langtype">
    <option value="alllang">All languages</option>
    <option value="AP">English</option>
    <option value="AR">German</option>
    <option value="AT">French</option>
    <option value="AU">Spanish</option>
    <option value="BA">Russian</option>
    </select></a> <img src="images/blue_help1.gif" border="0"></td>
    <td valign="top" bgcolor="#C3C8D1">
    &nbsp; <A CLASS="SmBlackText"><input type="checkbox" name="autostem" value="Relevance">Autostemming off &nbsp; <img src="images/blue_help1.gif" border="0">

    </tr>
    <tr>
    <td valign="top" height="4" colspan="3" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" height="4"></td>
    </tr>

    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1" colspan="2"><A CLASS="MedBlackText">
    <select name="langtype">
    <option value="PUD">Publication date</option>
    <option value="FID">Filed date</option>
    <option value="PRD">Priority date</option>
    </select></a> <img src="images/blue_help1.gif" border="0"></td>
    </tr>
    <tr>
    <td valign="top" height="4" colspan="3" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" height="4"></td>
    </tr>
    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr><td valign="top">&nbsp; &nbsp;
    <select name="year1">
    <option value="2003">2003</option>
    <option value="2002">2004</option>
    <option value="2005">2005</option>
    </select></a>
    <A CLASS="SmBlueTableText">TO</a>
    <A CLASS="MedBlackText">
    <SELECT NAME="year2">
    <option value="2002">2003</option>
    <option value="2004">2004</option>
    <option value="2003" selected>2005</option>
    </SELECT></a></td></tr>
    <tr><td height="4"><img src="images/spacer.gif" height="4"></td></tr>

    </table>
    </td>
    <td valign="bottom">&nbsp; <A CLASS="MedBlackText"><img src="images/search_orange1.gif" border="0"></a>&nbsp; &nbsp; <a href="#" onClick="document.search.reset()"><img src="images/reset_orange1.gif" border="0"></td>
    </tr>
    </table>
    </td></tr>
    <tr><td valign="top" colspan="4" height="1"><img src="images/spacer.gif" border="0" height="1" width="455"></td></tr>
    </table>
    </form>

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,495
    Thanks
    3
    Thanked 500 Times in 487 Posts
    PHP Code:
    .............
    <
    script language="JavaScript" type="text/javascript">
    <!--
    // Your HTML needs a major tidy to get this looking OK

    var CBAry=new Array('all','cpx','insp','ntis','patent')
    // Select Boxes have been given following ids in addition to name as names are duplicated
    var SelAry=new Array('doctype','langtype1','langtype2','year1','year2')

    function 
    FindCB(){
     
    cb=document.getElementsByTagName('INPUT');
     for (
    i=0;i<cb.length;i++){
      for (
    i1=0;i1<CBAry.length;i1++){
       if (
    cb[i].name==CBAry[i1]){
        
    cb[i].onclick=function(){ ChkCB(); }
        
    CBAry[i1]=cb[i];
       }
      }
     }
     
    sel=document.getElementsByTagName('SELECT');
     for (
    j=0;j<sel.length;j++){
      for (
    j1=0;j1<SelAry.length;j1++){
       if (
    sel[j].id==SelAry[j1]){
        
    SelAry[j1]=sel[j];
       }
      }
     }
     
    ChkCB();
    }

    function 
    ChkCB(){
     for (
    k1=0;k1<SelAry.length;k1++){
      
    SelAry[k1].style.visibility='hidden';
     }
     if (
    CBAry[0].checked){
      
    SelAry[0].style.visibility='visible';
      
    SelAry[2].style.visibility='visible';
     }
     if (
    CBAry[1].checked){
      
    SelAry[1].style.visibility='visible';
      
    SelAry[3].style.visibility='visible';
     }
     if (
    CBAry[2].checked){
      
    SelAry[3].style.visibility='visible';
     }
     if (
    CBAry[3].checked){
      
    SelAry[4].style.visibility='visible';
     }
     if (
    CBAry[4].checked){
      
    SelAry[2].style.visibility='visible';
      
    SelAry[4].style.visibility='visible';
     }
    }
    //-->
    </script>


    </head>

    <body onload="FindCB();" >

    ............ 

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just checked the code and I am not 100% sure about the script and also can I use it in simple html website (since it is for PHP, I have no idea about PHP)? When I copied the code and tested, it is throwing javascript error in function ChkCB(). I am not understanding what this function is doing.

    Thanks for the help

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I wrote this a while ago....

    I got a script which me and my friend wrote a couple of years ago. But this is for a drop down (The databases are in a drop down). But if I have to make these databases as check boxes (as I posted originally) how should I modify this existing code? I tried and its throwing erros because of checking and unchecking event.

    The reason I want to modify the below code is because it works even in NN 4.7 which is what we want.

    <HTML>
    <HEAD>
    <TITLE>Welcome</title>

    <SCRIPT LANGUAGE="JavaScript">

    <!--

    if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >3 )) {

    document.write("<LINK REL=stylesheet HREF=\"net4.css\" TYPE=\"text/css\">"); }

    else if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >3 )) {

    document.write("<LINK REL=stylesheet HREF=\"ie4.css\" TYPE=\"text/css\">"); }

    else {

    document.write("<LINK REL=stylesheet HREF=\"ie3.css\" TYPE=\"text/css\">"); }

    // -->

    </script>


    <SCRIPT LANGUAGE="javascript">

    //global variables

    var layerRef="null",layerStyleRef="null",styleSwitch="null";
    var layerShowing="layer1";

    function init(){
    if (navigator.appName == "Netscape") {
    layerStyleRef="layer.";
    layerRef="document.layers";
    styleSwitch="";
    }else{
    layerStyleRef="layer.style.";
    layerRef="document.all";
    styleSwitch=".style";
    }
    }
    function changeDisplay(choice){
    //don't do anything if no option was selected
    hideLayer(layerShowing);
    if (choice == "Compendex"){
    var layerToShow="layer1";
    }else if (choice == "Compendex: Last 2 Weeks Only"){
    var layerToShow="layer2";
    }else if (choice == "Website Abstracts"){
    var layerToShow="layer3";
    }else if (choice == "US Patent Office"){
    var layerToShow="layer4";
    }else if (choice == "CRC Press Handbooks"){
    var layerToShow="layer5";
    }else if (choice == "Industry Specs and Standards"){
    var layerToShow="layer6";
    }
    showLayer(layerToShow);
    layerShowing=layerToShow;
    }

    function showLayer(layerName){
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
    }
    function hideLayer(layerName){
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
    }

    </script>

    <STYLE TYPE="text/css">
    #layer1 {POSITION: absolute; Z-INDEX: 49100; VISIBILITY: visible; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    #layer2 {POSITION: absolute; Z-INDEX: 49150; VISIBILITY: hidden; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    #layer3 {POSITION: absolute; Z-INDEX: 49200; VISIBILITY: hidden; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    #layer4 {POSITION: absolute; Z-INDEX: 49250; VISIBILITY: hidden; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    #layer5 {POSITION: absolute; Z-INDEX: 49300; VISIBILITY: hidden; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    #layer6 {POSITION: absolute; Z-INDEX: 49350; VISIBILITY: hidden; LEFT: 10px; TOP: 265px; WIDTH: 196px; HEIGHT: 190px}
    </STYLE>

    </head>
    <BODY BGCOLOR="#FFFFFF" onLoad="init()">
    <!-- start search and white results page -->
    <TABLE BGCOLOR="#ffffff" WIDTH="200" CELLPADDING="0" CELLSPACING="0" BORDER="0">
    <TR><TD VALIGN="TOP" HEIGHT="200">
    <BR>
    <!--the form that will control things-->
    <FORM NAME="layerChanger">
    <A CLASS="ExSmBlueTableText">1.</A>
    <A CLASS="ExSmBlackText">SELECT A DATABASE:<BR>
    <SELECT NAME="options" onChange="changeDisplay(this.options[this.selectedIndex].text);">
    <OPTION VALUE="Compendex">Compendex</OPTION>
    <OPTION VALUE="Compendex2Weeks">Compendex: Last 2 Weeks Only</OPTION>
    <OPTION VALUE="webabstracts">Website Abstracts</OPTION>
    <OPTION VALUE="USPatents">US Patent Office</OPTION>
    <OPTION VALUE="CRCpress">CRC Press Handbooks</OPTION>
    <OPTION VALUE="CssInfo">Industry Specs and Standards</OPTION>
    </SELECT>
    </A>
    </FORM>
    </td></tr>
    </table>

    <!--layers that will be accessed by the form-->

    <DIV ID="layer1">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A> |
    <A CLASS="ExSmBlackText" href="#" onClick="lookupwindow();">Index of Terms</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH BY:<BR>
    <select name="field1">
    <font size="2">
    <option value="Keywords">Keywords</option>
    <option value="Author">Author</option>
    <option value="Title">Publication Title</option>
    </font>
    </select>
    <BR>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">
    <BR>
    </A>

    <A CLASS="ExSmBlackText">
    * To add more criteria to your search, click&nbsp;</A>
    <A HREF="indexcomp.html#search"><IMG SRC="images/addfields.gif" BORDER="0"></A>

    <P>
    <A CLASS="ExSmBlueTableText">3.</A>
    <A CLASS="ExSmBlackText">
    SEARCH FROM:<BR>
    <SELECT NAME="year1">

    <OPTION VALUE="1995" SELECTED>1995</option>
    <OPTION VALUE="1996">1996</option>
    <OPTION VALUE="1997">1997</option>
    <OPTION VALUE="1998">1998</option>
    <OPTION VALUE="1999">1999</option>
    </SELECT>
    TO
    <SELECT NAME="year2">
    <OPTION VALUE="1995">1995</option>
    <OPTION VALUE="1996">1996</option>
    <OPTION VALUE="1997">1997</option>
    <OPTION VALUE="1998">1998</option>
    <OPTION VALUE="1999">1999</option>
    <OPTION VALUE="2000" SELECTED>2000</option>
    </SELECT>
    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="compendex">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </div>

    <DIV ID="layer2">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A> |
    <A CLASS="ExSmBlackText" href="#" onClick="lookupwindow();">Index of Terms</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH BY:<BR>
    <select name="field1">
    <option value="Keywords">Keywords</option>
    <option value="Author">Author</option>
    <option value="Title">Publication Title</option>

    </select>
    <BR>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">
    <BR>
    </A>
    <A CLASS="ExSmBlackText">
    * To add more criteria to your search, click&nbsp;</A>
    <A HREF="favvillage2.html#search"><IMG SRC="images/addfields.gif" BORDER="0"></A><P>
    <A CLASS="ExSmBlackText">
    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="compendex2years">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </DIV>


    <DIV ID="layer3">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A> |
    <A CLASS="ExSmBlackText" href="#" onClick="lookupwindow();">Index of Terms</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH IN: <BR>
    <select name="field1">
    <option value="Keywords">Keywords</option>
    </select>
    <P>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">
    <BR>
    </A>
    <A CLASS="ExSmBlackText">
    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="webabstracts">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </DIV>


    <DIV ID="layer4">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH BY:<BR>
    <select name="field1">
    <option value="Keywords">Keywords</option>
    <option value="Title">Title</option>
    <option value="PatentNum">Patent Number</option>
    <option value="ApplicationNum">Application Number</option>
    <option value="Inventor">Inventor</option>
    <option value="Company">Assignee/Company</option>
    <option value="IntlClass">Int'l Patent Classification No.</option>
    <option value="USClass">US Patent Classification No.</option>
    </select>
    <BR>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">
    <BR>
    </A>
    <P>
    <A CLASS="ExSmBlackText">
    * To add more criteria to your search, click&nbsp;</A>
    <A HREF="hope3.html"><IMG SRC="images/addfields.gif" BORDER="0"></A><P>
    <A CLASS="ExSmBlueTableText">3.</A>
    <A CLASS="ExSmBlackText">
    SEARCH FROM:<BR>
    <SELECT NAME="year">
    <OPTION VALUE="1999" SELECTED>1999 - 2000</option>
    <OPTION VALUE="1998">1998</option>
    <OPTION VALUE="1997">1997</option>
    <OPTION VALUE="1996">1996</option>
    <OPTION VALUE="1995">1995</option>
    </SELECT>


    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="uspatents">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </DIV>

    <DIV ID="layer5">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH BY:<BR>
    <select name="field1">
    <option value="Keywords">Keywords</option>
    </select>
    <BR>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">

    <BR>
    </A>
    <P>
    <A CLASS="ExSmBlackText">

    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="crchandbooks">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </DIV>


    <DIV ID="layer6">
    <IMG SRC="images/help.gif" ALIGN="ABSMIDDLE">
    <A CLASS="ExSmBlackText" href="#" onClick="tipswindow();">Search Tips</A>|
    <A CLASS="ExSmBlackText" href="#" onClick="pubwindow();">Publisher Index</A>
    <FORM>
    <A CLASS="ExSmBlueTableText">2.</A>
    <A CLASS="ExSmBlackText">
    SEARCH BY:<BR>
    <select name="field1">
    <option value="Keywords">Keywords</option>
    <option value="Title">Title</option>
    <option value="Publisher">Publisher</option>
    <option value="DocNum">Document Number</option>
    </select>
    <BR>
    FOR
    <BR>
    <input type="text" size="22" NAME="field1value" maxlength="128">
    <BR>
    </A>
    <P>
    <A CLASS="ExSmBlackText">
    * To add more criteria to your search, click&nbsp;</A>
    <A HREF="hope3.html"><IMG SRC="images/addfields.gif" BORDER="0"></A><P>
    <A CLASS="ExSmBlackText">
    <HR WIDTH="170">
    <INPUT TYPE="hidden" NAME="datacontiner" VALUE="cssinfo">
    &nbsp;<input type="image" name="submit" src="images/search.gif" BORDER="0">&nbsp;&nbsp;<INPUT TYPE="image" NAME="reset" src="images/reset.gif" BORDER="0"><BR>
    </form>
    </A>
    </DIV>



    <!-- end of layers -->
    </body></html>
    Last edited by chelvis; 04-11-2005 at 09:31 PM.

  • #5
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,495
    Thanks
    3
    Thanked 500 Times in 487 Posts
    you first posted code with modifications



    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd"
    >

    <
    html>

    <
    head>
      <
    title></title>

    <
    script language="JavaScript" type="text/javascript">
    <!--
    // Your HTML needs a major tidy to get this looking OK

    var CBAry=new Array('all','cpx','insp','ntis','patent')
    // Select Boxes have been given following ids in addition to name as names are duplicated
    var SelAry=new Array('doctype','langtype1','langtype2','year1','year2')

    function 
    FindCB(){
     
    cb=document.getElementsByTagName('INPUT');
     for (
    i=0;i<cb.length;i++){
      for (
    i1=0;i1<CBAry.length;i1++){
       if (
    cb[i].name==CBAry[i1]){
        
    cb[i].onclick=function(){ ChkCB(); }
        
    CBAry[i1]=cb[i];
       }
      }
     }
     
    sel=document.getElementsByTagName('SELECT');
     for (
    j=0;j<sel.length;j++){
      for (
    j1=0;j1<SelAry.length;j1++){
       if (
    sel[j].id==SelAry[j1]){
        
    SelAry[j1]=sel[j];
       }
      }
     }
     
    ChkCB();
    }

    function 
    ChkCB(){
     for (
    k1=0;k1<SelAry.length;k1++){
      
    SelAry[k1].style.visibility='hidden';
     }
     if (
    CBAry[0].checked){
      
    SelAry[0].style.visibility='visible';
      
    SelAry[2].style.visibility='visible';
     }
     if (
    CBAry[1].checked){
      
    SelAry[1].style.visibility='visible';
      
    SelAry[3].style.visibility='visible';
     }
     if (
    CBAry[2].checked){
      
    SelAry[3].style.visibility='visible';
     }
     if (
    CBAry[3].checked){
      
    SelAry[4].style.visibility='visible';
     }
     if (
    CBAry[4].checked){
      
    SelAry[2].style.visibility='visible';
      
    SelAry[4].style.visibility='visible';
     }
    }
    //-->
    </script>
    </head>

    <body onload="FindCB();" >

    <form name="search">
    <table border="0" cellspacing="0" cellpadding="0" width="600" bgcolor="#C3C8D1">
    <tr><td valign="top" height="20" colspan="4"><img src="images/spacer.gif" border="0" height="20"></td></tr>
    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" colspan="3" bgcolor="#C3C8D1"><a CLASS="SmBlueTableText"><b>SELECT DATABASE</b></a></td>
    </tr>
    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td width="550" valign="top" colspan="2" bgcolor="#C3C8D1">
    <table border="0" width="550" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top" width="100">
    <input type="checkbox" name="all"><a CLASS="SmBlackText"> All</a>
    </td>
    <td valign="top" width="115">
    <input type="checkbox" name="cpx">
    <a CLASS="SmBlackText"> Compendex</a></td><td valign="top" width="85">
    <input type="checkbox" name="insp"><a CLASS="SmBlackText">Inspec</a>
    </td>
    <td valign="top" width="100">
    <input type="checkbox" name="ntis"><a CLASS="SmBlackText">NTIS</a>
    </td>
    <td valign="top" width="250"><input type="checkbox" name="patent" checked><a CLASS="SmBlackText">Patents </a><a CLASS="ExSmBlackText">(European only)</a>&nbsp; <img src="images/blue_help1.gif" border="0">
    </td>
    </tr>
    </table>                                               all,cpx,insp,ntis,patent
    </td>
    </tr>

    <tr>
    <td valign="top" width="4" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="4"></td>
    <td valign="top" colspan="3">
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
    <td valign="top" colspan="2" bgcolor="#C3C8D1"><A CLASS="SmBlueTableText"><B>LIMIT BY</b></a></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="SmBlueTableText"><B>SORT BY</b></a></td>
    </tr>

    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="MedBlackText">
    <select id="doctype" name="doctype">
    <OPTION VALUE="all">document type1</OPTION>
    <OPTION VALUE="bookchapter">Document type2</OPTION>
    <OPTION VALUE="journalpaper">Docuemnt type3</OPTION>
    </SELECT></a> <img src="images/blue_help1.gif" border="0"></td>
    <td valign="top" bgcolor="#C3C8D1">
    &nbsp; <A CLASS="SmBlackText"><input type="radio" name="sort" value="Relevance" checked>Relevance
    &nbsp; <input type="radio" name="sort" value="date">Publication year</a></td>
    </tr>

    <tr><td valign="top" colspan="3" height="4"><img src="images/spacer.gif" border="0" height="4"></td></tr>
    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1"><A CLASS="MedBlackText">

    <select id="langtype1" name="langtype">
    <option value="alllang">All languages</option>
    <option value="AP">English</option>
    <option value="AR">German</option>
    <option value="AT">French</option>
    <option value="AU">Spanish</option>
    <option value="BA">Russian</option>
    </select></a> <img src="images/blue_help1.gif" border="0"></td>
    <td valign="top" bgcolor="#C3C8D1">
    &nbsp; <A CLASS="SmBlackText"><input type="checkbox" name="autostem" value="Relevance">Autostemming off &nbsp; <img src="images/blue_help1.gif" border="0">

    </tr>
    <tr>
    <td valign="top" height="4" colspan="3" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" height="4"></td>
    </tr>

    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1" colspan="2"><A CLASS="MedBlackText">

    <select id="langtype2" name="langtype">
    <option value="PUD">Publication date</option>
    <option value="FID">Filed date</option>
    <option value="PRD">Priority date</option>
    </select></a>
     <img src="images/blue_help1.gif" border="0"></td>
    </tr>
    <tr>
    <td valign="top" height="4" colspan="3" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" height="4"></td>
    </tr>
    <tr>
    <td valign="top" width="15" bgcolor="#C3C8D1"><img src="images/spacer.gif" border="0" width="15"></td>
    <td valign="top" bgcolor="#C3C8D1">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr><td valign="top">&nbsp; &nbsp;

    <select id="year1" name="year1">
    <option value="2003">2003</option>
    <option value="2002">2004</option>
    <option value="2005">2005</option>
    </select></a>

    <A CLASS="SmBlueTableText">TO</a>
    <A CLASS="MedBlackText">

    <SELECT  id="year2" NAME="year2">
    <option value="2002">2003</option>
    <option value="2004">2004</option>
    <option value="2003" selected>2005</option>
    </SELECT>
    </a></td></tr>
    <tr><td height="4"><img src="images/spacer.gif" height="4"></td></tr>

    </table>
    </td>
    <td valign="bottom">&nbsp; <A CLASS="MedBlackText"><img src="images/search_orange1.gif" border="0"></a>&nbsp; &nbsp; <a href="#" onClick="document.search.reset()"><img src="images/reset_orange1.gif" border="0"></td>
    </tr>
    </table>
    </td></tr>
    <tr><td valign="top" colspan="4" height="1"><img src="images/spacer.gif" border="0" height="1" width="455"></td></tr>
    </table>
    </form>
    </body>

    </html> 

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can you modify my second post?

    Thanks for the correction. But can some one modify my second (chelvis) post? Originally it is written for a drop down. But I want to make them as check boxes. Because it would be easy for me to use instead of what VWphillips posted (I felt it is a bit complicated and advanced to understand his code - I am not yet to that level)

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    It is not working..

    I just checked vwphillips code last night and it is only showing or hiding the form elements. It is not hiding the "TO" word between the year range and also the "help" image icon. Also when it hides a specific dropdown that space becomes a blank area. Is there any way we can move the other dropdowns closer to each other when certain elements are hidden?

    I think the second time I posted a long code is some what working that way. But the only problem is I wrote it for a drop down and now I dont know how to convert it for check boxes. (I havent worked with check boxes almost at all).


  •  

    Posting Permissions

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