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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Set selects, selected, by link or checkbox

    I have a form that has select boxes for the hours, mins and meridiems for each day of the week. It is a form that deals with a department within a company and the hours of operation.

    What I would like to do is set a link (or checkbox if easier) beside all of the days that says "Mark same as above" and when clicked, it would take that row of selects and set them all to the same as the fields above them.

    The reason for this is the form has a From and a To range, so they would have to select the hour, minute, meridiem for the From range then do it again for the To range and repeat this 7 times (once for each day of week). If a dept happens to have the same hours for 5 days out of the week, there is no need to make them keep selecting the same choices when they could click a link or checkbox to set each one individually like the row above it.

    I was wondering if I could somehow take the current selections say for monday and have a link beside tuesday that would pass a query string to the page and set tuesday.

    //Let's say the form name is "depts"

    //the fields for monday and tuesday are "mon_from_hour", "mon_from_min", "mon_from_meridiem", "tue_from_hour", "tue_from_min", "tue_from_meridiem"

    Code:
    //link beside the tuesday row: (I know this is incorrect but a psuedo code link would look like:)
    <a href="testpage.php?mondayhour=document.depts.mon_from_hour.value">Mark same as above</a>
    
    then once clicked (for the sake of time I will only do the hour here...because if I can get this to work, I can get the rest)
    
    
    
    <select name=\"mon_from_hour\">";
    											
    //PHP code:										
    for ($i = 1; $i <= 12; $i++)
    {
    if ($_GET["mondayhour"] == $i)
    $value .= "<option value=\"".$i."\" selected>".$i."</option>";
    
    if ($_GET["mondayhour"] <> $i)
    $value .= "<option value=\"".$i."\">".$i."</option>";													
    }
    										
    $value .= "</select>";
    
    echo $value;
    or with checkbox

    Code:
    <script>
    function setit()
    {
    if (document.depts.tuesday_set.checked)
    document.depts.tue_from.hour.value = document.depts.mon_from.hour.value;
    
    //or however you would say "Set the Tuesday from hour that equals monday's from hour to selected"
    }
    
    </script>
    
    
    <input type=checkbox name=tuesday_set onclick=\"return setit()\"> Mark same
    How can I pull this off? Even if I don't use a link to call the page and pass a query string, can I use a checkbox instead? And when checked it set the selected values for that row to the row above it?

    Thank you for any help with this.
    Last edited by tripwater; 12-21-2005 at 05:06 PM.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    save me thinking and have a look at

    http://www.vicsjavascripts.org.uk/Fo...endium.htm#f12

    this first

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks for the reply, but none of the scripts on that page seem to help. I only see select disabling,No Duplicate Selects and Move Select Box Option none of which show me how to take info from one select(droplist) and set the selected option on another select(droplist) to what is currently selected in the first by way of a link or checkbox.

    See, I don't want the user to have to select anything in the droplist if what they want is already set in the row above. They would just click a link or checkbox and the fields would all be set to the same as teh row above.

    Thanks again
    Last edited by tripwater; 12-21-2005 at 06:20 PM.

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    have a look as this DRAFT
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    // AsMaster Select (21-12-2005)  DRAFT
    // by Vic Phillips http://www.vicsjavascripts.org.uk/
    
    // A checkbox enables a selectlist duplicating the selected index of a master SelectList
    
    // Application Notes
    // The SelectLists and Check boxes must be nested in an element with a unique ID
    // The check boxes must have a onclick event zxcAsMasterSelect(this,'Grp1',0,1);"
    // Where:
    // parameter 0 = the checkbox object                                                 (object)
    // parameter 1 = the  unique ID of the parent element                                (string)
    // parameter 2 = the number  (order in the parent element) of the master selectlist  (digit 0 to n)
    // parameter 3 = the number (order in the parent element) of the slave selectlist    (digit 0 to n)
    
    // All function, variable names are prefixed with 'zxc' to minimise conflicts with other JavaScripts
    
    // The functional Code(2k) is best as an external javascript
    
    // Tested with IE6 and Mozilla FireFox
    
    // Functional Code - NO NEED to Change
    
    function zxcAsMasterSelect(zxcobj,zxcpid,zxcmaster,zxcslave){
     var zxcpobj=document.getElementById(zxcpid);
     zxcpobj.sel=zxcpobj.getElementsByTagName('SELECT');
     if (!zxcpobj.sel[zxcmaster].ary){
      zxcpobj.sel[zxcmaster].ary=new Array();
     }
     if (zxcobj.checked){
      zxcpobj.sel[zxcmaster].ary.push(zxcpobj.sel[zxcslave]);
      zxcpobj.sel[zxcslave].selectedIndex=zxcpobj.sel[zxcmaster].selectedIndex;
      zxcpobj.sel[zxcslave].setAttribute('disabled','disabled');
     }
     else {
      zxcpobj.sel[zxcslave].removeAttribute('disabled');
      zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.remove(zxcpobj.sel[zxcmaster].ary,zxcpobj.sel[zxcslave]);
     }
     zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.noduplicates(zxcpobj.sel[zxcmaster].ary);
     zxcAddChange(zxcpobj.sel[zxcmaster])
    }
    
    function zxcChange(){
     if (this.ary.length<1){ return; }
     for (var zxc0=0;zxc0<this.ary.length;zxc0++){
      this.ary[zxc0].selectedIndex=this.selectedIndex;
     }
    }
    
    Array.prototype.remove=function(zxcrema,zxcremi){
     for (var zxc0=0;zxc0<zxcrema.length;zxc0++){
      if (zxcrema[zxc0]==zxcremi){
       zxcrema.splice(zxc0,1);
      }
     }
     return zxcrema;
    }
    
    Array.prototype.noduplicates=function(zxca){
     if (zxca.length<2){ return zxca; }
     zxctemp=[zxca[0]];
     for (zxc1=0;zxc1<zxca.length;zxc1++){
      zxcck=true;
      for (zxc2=0;zxc2<zxctemp.length;zxc2++){ if (zxctemp[zxc2]==zxca[zxc1]){ zxcck=false; } }
      if (zxcck){ zxctemp[zxctemp.length]=zxca[zxc1]; }
     }
     return zxctemp;
    }
    
    function zxcEventAdd(zxco,zxct,zxcf) {
     if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
     else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
     else {
      var zxcPrev=zxco["on" + zxct];
      if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
      else { zxco['on'+zxct]=zxco[zxcf]; }
     }
    }
    
    function zxcAddChange(zxc){
     if (zxc.addChange){ return; }
     zxc.addChange=zxcChange;
     zxcEventAdd(zxc,'change','addChange');
    }
    
    
    //-->
    </script></head>
    
    <body>
    <a id="Grp1" >
    <select >
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select> Master Select
    <br>
    <select>
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select>
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',0,1);"> As Master
    <br>
    <select >
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select>
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',0,2);" > As Master
    </a>
    </body>
    
    </html>
    Last edited by vwphillips; 12-21-2005 at 10:44 PM.

  • #5
    Regular Coder
    Join Date
    Sep 2005
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nice script VWP! I like the small touches you added, like disabling the selects when the box is checked, as well as having the "slaves" reflect the master whenever the master changes (I was just thinking of having the slaves selectedIndex = master's sI when box is clicked, but didn't think about what would happen if the person changed master's value afterward...)

    tripwater: This is probably the best way to do this so that you do not have to constantly refresh the page each time the user makes a change. But be aware that this is basically a javascript solution, which means that the client computers would need to have js turned on in order for them to have the added features. It sounds as though this might be an internal web application, which would be good since you'd be able to verify that the users have js turned on. However, if this is a public web site, then just be aware that some users may not be able to use these features (although the scripts are used to enhance the page, and are not required to use the site; without js, the users will just have to suffer through entering in each select instead of using the checkbox feature). If this is the case (that its public web site), you may want to make a note on your page letting users know that the added features require js (maybe "Javascript Enhanced Site"). If you feel you need everyone to be able to use these features, then you may need to resort to a php solution...
    If you want answers, write a smart question.

    Yes, someone probably does know how...

    Oh, and if you want to learn, STFW!

  • #6
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    thanks Pyth007

    this is what I did not have time for last night, 'inheritance' or is 'ancenstry'

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    // AsMaster Select (21-12-2005)  DRAFT
    // by Vic Phillips http://www.vicsjavascripts.org.uk/
    
    // A checkbox enables a selectlist duplicating the selected index of a master SelectList
    
    // Application Notes
    // The SelectLists and Check boxes must be nested in an element with a unique ID
    // The check boxes must have a onclick event zxcAsMasterSelect(this,'Grp1',0,1);"
    // Where:
    // parameter 0 = the checkbox object                                                 (object)
    // parameter 1 = the  unique ID of the parent element                                (string)
    // parameter 2 = the number  (order in the parent element) of the master selectlist  (digit 0 to n)
    // parameter 3 = the number (order in the parent element) of the slave selectlist    (digit 0 to n)
    
    // All function, variable names are prefixed with 'zxc' to minimise conflicts with other JavaScripts
    
    // The functional Code(2k) is best as an external javascript
    
    // Tested with IE6 and Mozilla FireFox
    
    
    // Functional Code - NO NEED to Change
    
    function zxcAsMasterSelect(zxcobj,zxcpid,zxcmaster,zxcslave){
     var zxcpobj=document.getElementById(zxcpid);
     zxcpobj.sel=zxcpobj.getElementsByTagName('SELECT');
     if (!zxcpobj.sel[zxcmaster].ary){
      zxcpobj.sel[zxcmaster].ary=new Array();
     }
     if (zxcobj.checked){
      zxcpobj.sel[zxcmaster].ary.push(zxcpobj.sel[zxcslave]);
      zxcpobj.sel[zxcslave].selectedIndex=zxcpobj.sel[zxcmaster].selectedIndex;
      zxcpobj.sel[zxcslave].setAttribute('disabled','disabled');
     }
     else {
      zxcpobj.sel[zxcslave].removeAttribute('disabled');
      zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.remove(zxcpobj.sel[zxcmaster].ary,zxcpobj.sel[zxcslave]);
     }
     zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.noduplicates(zxcpobj.sel[zxcmaster].ary);
     zxcAddChange(zxcpobj.sel[zxcmaster])
    }
    
    function zxcChange(){
     if (this.ary.length<1){ return; }
     for (var zxc0=0;zxc0<this.ary.length;zxc0++){
      this.ary[zxc0].selectedIndex=this.selectedIndex;
      if (this.ary[zxc0].ary){ 
       if (this.ary[zxc0].ary.length>0){
        for (var zxc1=0;zxc1<this.ary[zxc0].ary.length;zxc1++){
         this.ary[zxc0].ary[zxc1].selectedIndex=this.ary[zxc0].selectedIndex;
        }
       }
      }
     }
    }
    
    
    Array.prototype.remove=function(zxcrema,zxcremi){
     for (var zxc0=0;zxc0<zxcrema.length;zxc0++){
      if (zxcrema[zxc0]==zxcremi){
       zxcrema.splice(zxc0,1);
      }
     }
     return zxcrema;
    }
    
    Array.prototype.noduplicates=function(zxca){
     if (zxca.length<2){ return zxca; }
     zxctemp=[zxca[0]];
     for (zxc1=0;zxc1<zxca.length;zxc1++){
      zxcck=true;
      for (zxc2=0;zxc2<zxctemp.length;zxc2++){ if (zxctemp[zxc2]==zxca[zxc1]){ zxcck=false; } }
      if (zxcck){ zxctemp[zxctemp.length]=zxca[zxc1]; }
     }
     return zxctemp;
    }
    
    function zxcEventAdd(zxco,zxct,zxcf) {
     if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
     else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
     else {
      var zxcPrev=zxco["on" + zxct];
      if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
      else { zxco['on'+zxct]=zxco[zxcf]; }
     }
    }
    
    function zxcAddChange(zxc){
     if (zxc.addChange){ return; }
     zxc.addChange=zxcChange;
     zxcEventAdd(zxc,'change','addChange');
    }
    
    
    //-->
    </script></head>
    
    <body>
    <a id="Grp1" >
    <select >
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select> Master Select
    <br>
    <select>
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select>
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',0,1);"> As Master
    <br>
    <select >
    <option >Tom</option>
    <option >Dick</option>
    <option >Harry</option>
    <option >Joe</option>
    </select>
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',1,2);" > As Master
    </a>
    </body>
    
    </html>

  • #7
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you so very much for your reply. This is really cool. I have one more question...your example shows one set of selects in each row. If I was to try this script on my code which has

    Code:
    <select name="mon_from_hour">
    <option value="1">1</option>
    </select>
    
    <select name="mon_from_min">
    <option value="15">15</option>
    </select>
    
    <select name="mon_from_meridiem">
    <option value="AM">AM</option>
    </select>
    
    
    <select name="mon_to_hour">
    <option value="1">1</option>
    </select>
    
    
    <select name="mon_to_min">
    <option value="15">15</option>
    </select>
    
    
    <select name="mon_to_meridiem">
    <option value="AM">AM</option>
    </select>


    This is one row. I would like for all of these selects in Monday to be what Tuesday's selects are changed to if the checkbox beside Tuesday is checked. So I am basically dealing with 6 selects for each day.

    Thank you again.
    Last edited by tripwater; 12-22-2005 at 05:21 PM.

  • #8
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    the selects can be in any order/position nested in the same parent element but

    the call master and slave numbers must be the the selectlist number (0 to n) for the relavent master and slave in the parent element(I wanted to avoid ids and names).

    There may be as many sets of slave and master as required.

    thats the theory anyway, limited testing as it is a new script.

    edit the ckeck box can be positioned anywhere so long as it has the correct master and slave numbers
    but I need to think about your application.
    Thinks, there can be more than one function call in the checkbox on click event calling a number of slave and master relationships which should meet your requirement
    Last edited by vwphillips; 12-22-2005 at 06:01 PM.

  • #9
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Yes, the checkbox beside the row Tuesday, should ONLY change Tuesday's selects to what Monday is set to and Wednesday's checkbox only set Wednesday to Tuesday's settings respectively.

    thank you again for your time. I am still a bit confused but I am going to play with your code a bit and see if I can figure it out.

  • #10
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    tested this, works as the theory

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    // AsMaster Select (21-12-2005)  DRAFT
    // by Vic Phillips http://www.vicsjavascripts.org.uk/
    
    // A checkbox enables a selectlist duplicating the selected index of a master SelectList
    
    // Application Notes
    // The SelectLists and Check boxes must be nested in an element with a unique ID
    // The check boxes must have a onclick event zxcAsMasterSelect(this,'Grp1',0,1);"
    // Where:
    // parameter 0 = the checkbox object                                                 (object)
    // parameter 1 = the  unique ID of the parent element                                (string)
    // parameter 2 = the number  (order in the parent element) of the master selectlist  (digit 0 to n)
    // parameter 3 = the number (order in the parent element) of the slave selectlist    (digit 0 to n)
    
    // All function, variable names are prefixed with 'zxc' to minimise conflicts with other JavaScripts
    
    // The functional Code(2k) is best as an external javascript
    
    // Tested with IE6 and Mozilla FireFox
    
    
    // Functional Code - NO NEED to Change
    
    function zxcAsMasterSelect(zxcobj,zxcpid,zxcmaster,zxcslave){
     var zxcpobj=document.getElementById(zxcpid);
     zxcpobj.sel=zxcpobj.getElementsByTagName('SELECT');
     if (!zxcpobj.sel[zxcmaster].ary){
      zxcpobj.sel[zxcmaster].ary=new Array();
     }
     if (zxcobj.checked){
      zxcpobj.sel[zxcmaster].ary.push(zxcpobj.sel[zxcslave]);
      zxcpobj.sel[zxcslave].selectedIndex=zxcpobj.sel[zxcmaster].selectedIndex;
      zxcpobj.sel[zxcslave].setAttribute('disabled','disabled');
     }
     else {
      zxcpobj.sel[zxcslave].removeAttribute('disabled');
      zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.remove(zxcpobj.sel[zxcmaster].ary,zxcpobj.sel[zxcslave]);
     }
     zxcpobj.sel[zxcmaster].ary=zxcpobj.sel[zxcmaster].ary.noduplicates(zxcpobj.sel[zxcmaster].ary);
     zxcAddChange(zxcpobj.sel[zxcmaster])
    }
    
    function zxcChange(){
     if (this.ary.length<1){ return; }
     for (var zxc0=0;zxc0<this.ary.length;zxc0++){
      this.ary[zxc0].selectedIndex=this.selectedIndex;
      if (this.ary[zxc0].ary){
       if (this.ary[zxc0].ary.length>0){
        for (var zxc1=0;zxc1<this.ary[zxc0].ary.length;zxc1++){
         this.ary[zxc0].ary[zxc1].selectedIndex=this.ary[zxc0].selectedIndex;
        }
       }
      }
     }
    }
    
    
    Array.prototype.remove=function(zxcrema,zxcremi){
     for (var zxc0=0;zxc0<zxcrema.length;zxc0++){
      if (zxcrema[zxc0]==zxcremi){
       zxcrema.splice(zxc0,1);
      }
     }
     return zxcrema;
    }
    
    Array.prototype.noduplicates=function(zxca){
     if (zxca.length<2){ return zxca; }
     zxctemp=[zxca[0]];
     for (zxc1=0;zxc1<zxca.length;zxc1++){
      zxcck=true;
      for (zxc2=0;zxc2<zxctemp.length;zxc2++){ if (zxctemp[zxc2]==zxca[zxc1]){ zxcck=false; } }
      if (zxcck){ zxctemp[zxctemp.length]=zxca[zxc1]; }
     }
     return zxctemp;
    }
    
    function zxcEventAdd(zxco,zxct,zxcf) {
     if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
     else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
     else {
      var zxcPrev=zxco["on" + zxct];
      if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
      else { zxco['on'+zxct]=zxco[zxcf]; }
     }
    }
    
    function zxcAddChange(zxc){
     if (zxc.addChange){ return; }
     zxc.addChange=zxcChange;
     zxcEventAdd(zxc,'change','addChange');
    }
    
    
    //-->
    </script></head>
    
    <body>
    <a id="Grp1" >
    <select >
    <option >2000</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>0
    <select>
    <option >Jan</option>
    <option >Feb</option>
    <option >March</option>
    <option >April</option>
    </select>1
    <select >
    <option > 01 </option>
    <option > 02 </option>
    <option > 03 </option>
    <option > 04 </option>
    </select>2
    <select >
    <option >Not Included</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>3
    <br>
    <br>
    <br>
    <select >
    <option >2000</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>4
    <select>
    <option >Jan</option>
    <option >Feb</option>
    <option >March</option>
    <option >April</option>
    </select>5
    <select >
    <option > 01 </option>
    <option > 02 </option>
    <option > 03 </option>
    <option > 04 </option>
    </select>6
    <select >
    <option >Not Included</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>7
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',0,4);zxcAsMasterSelect(this,'Grp1',1,5);zxcAsMasterSelect(this,'Grp1',2,6);" >
    </a>
    </body>
    
    </html>

  • #11
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I see that this works perfectly!!!! But I do have one question though, The "a" tag that you have with the id="Grp1" is around the two sets of droplists. I understand that this groups them together. My question is now since I have 7 days in a week, if I group Mon and tuesday with this tag and label it as Grp1, can I then start another group inside this in order to group Tuesday with wednesday and so on?

    In other words, each line needs to group with the one below it so every day after Monday will technically grouped with the one before it and the one after it...does this make sense? If so, how will this work with more Than 2 rows? Say, with four?


    Below is an example of what I am talking about

    Code:
    <a id="Grp1" >
    <select >
    <option >2000</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>0
    <select>
    <option >Jan</option>
    <option >Feb</option>
    <option >March</option>
    <option >April</option>
    </select>1
    <select >
    <option > 01 </option>
    <option > 02 </option>
    <option > 03 </option>
    <option > 04 </option>
    </select>2
    <select >
    <option >Not Included</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>3
    <br>
    <br>
    <br>
    //this now needs to not only be grouped with the above row but the one
     //below it as well. Because if I check the box to the row below this one, it
     //needs to set that row to the values of this one and so on.
    
    <a id="Grp2">//beginning of group two
    <select >
    <option >2000</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>4
    <select>
    <option >Jan</option>
    <option >Feb</option>
    <option >March</option>
    <option >April</option>
    </select>5
    <select >
    <option > 01 </option>
    <option > 02 </option>
    <option > 03 </option>
    <option > 04 </option>
    </select>6
    <select >
    <option >Not Included</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>7
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp1',0,4);zxcAsMasterSelect(this,'Grp1',1,5);zxcAsMasterSelect(this,'Grp1',2,6);" >
    </a>//end of group 1
    
    <br>
    <br>
    <br>
    <select >
    <option >2000</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>4
    <select>
    <option >Jan</option>
    <option >Feb</option>
    <option >March</option>
    <option >April</option>
    </select>5
    <select >
    <option > 01 </option>
    <option > 02 </option>
    <option > 03 </option>
    <option > 04 </option>
    </select>6
    <select >
    <option >Not Included</option>
    <option >2001</option>
    <option >2002</option>
    <option >2003</option>
    </select>7
    <input type="checkbox" onclick="zxcAsMasterSelect(this,'Grp2',0,4);zxcAsMasterSelect(this,'Grp2',1,5);zxcAsMasterSelect(this,'Grp1',2,6);" >
    </a>//end of group two

    I know the above is incorrect but I hope it shows what I am talking about. Once we leave the first row of dates(Monday), every row(except the last...Sunday) will need to be associated with not only the row above it but the one below it. I do not mean to confuse...what you have is EXACTLY what I need. I need the checkbox to set the current list to the values of the one above it, only I do not see how to do it with more than two rows...since they are grouped together.

    THank you again for your help. THis is very close to what I need. I just tried grouping with more than two and could not get it to work is why I ask.
    Last edited by tripwater; 02-21-2006 at 07:52 PM.

  • #12
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Any ideas? Thanks

  • #13
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    just noticed this on

    so bumped so not to loose

  • #14
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I'm sorry, what? Did you mean to put a URL in the above post?

    Did you understand my question with applying your code to what I need? Incorporating more than one grouping with each line...

    thanks again

  • #15
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    still busy

    but will look at tomorrow hopefully


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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