Link to home
Start Free TrialLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

Clone node not cloning my select options...

Hi Again,

I have the following that is called from a button in the row to be cloned.

'<input type="BUTTON" value="Split" onClick="javascript:bc_SplitTableRow(this);">' " "

<script>
function bc_SplitTableRow(theLink){
  theRow = theLink.parentNode.parentNode;
  newRow = theRow.cloneNode(true);
  theRow.parentNode.insertBefore(newRow, theRow.nextSibling);
  return false;
}
</script>

The above creates the new row and clones the text items but does not set the select to the cloned values... ???
How do I do this?

Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Avatar of BILL Carlisle

ASKER

R.K.
That is adding files and couldn't see clearly where it clones select lists... ???

Thank you Bill
Here is one. Try it out:

<html>
      <head>
            <title>Script Demo Gops</title>
            <head>
                  <script type="text/javascript">
                        function bc_SplitTableRow(theLink){

                              theRow = theLink.parentNode.parentNode;
                              theTable=theRow.parentNode;
                              newRow = theRow.cloneNode(true);
                              theRow.parentNode.insertBefore(newRow, theRow.nextSibling);
                              var parentSelect=theRow.cells[1].childNodes[0].selectedIndex;
                              var newR=theRow.parentNode.rows.length-1;
                              theTable.rows[newR].cells[1].childNodes[0].selectedIndex=parentSelect;
                              return false;
                        }
                  </script>
            </head>
<body>
      <table border="0" cellspacing="2" cellpadding="2">
            <tr>
                  <td><input type="text" size="10" name="txt"></td>
                  <td>
                        <select name="selc">
                              <option>A
                              <option>B
                        </select>
                  </td>
                  <td><input type="button" value="Split" onClick="javascript:bc_SplitTableRow(this);"></td>
            </tr>
      </table>
</body>
</html>
Hi Gosp1,

I tried the below and it still didn't clone the selects.

   function bc_SplitTableRow(theLink){

       theRow = theLink.parentNode.parentNode;
       theTable=theRow.parentNode;
       newRow = theRow.cloneNode(true);
       theRow.parentNode.insertBefore(newRow, theRow.nextSibling);
       var parentSelect=theRow.cells[1].childNodes[0].selectedIndex;
       var newR=theRow.parentNode.rows.length-1;
       theTable.rows[newR].cells[1].childNodes[0].selectedIndex=parentSelect;
       return false;
    }

Bill
Not a problem Bill, I need to see your table structure and find a fix for it.
Yes, I see... here is your example with 2 additions:


<html>
     <head>
          <title>Script Demo Gops</title>
          <head>
               <script type="text/javascript">
                    function bc_SplitTableRow(theLink){

                         theRow = theLink.parentNode.parentNode;
                         theTable=theRow.parentNode;
                         newRow = theRow.cloneNode(true);
                         theRow.parentNode.insertBefore(newRow, theRow.nextSibling);
                         var parentSelect=theRow.cells[1].childNodes[0].selectedIndex;
                         var newR=theRow.parentNode.rows.length-1;
                         theTable.rows[newR].cells[1].childNodes[0].selectedIndex=parentSelect;
                         return false;
                    }
               </script>
          </head>
<body>
     <table border="0" cellspacing="2" cellpadding="2">
          <tr>
               <td><input type="text" size="10" name="txt"></td>
               <td>
                    <select name="selc1">
                         <option>A
                         <option>B
                    </select>
               </td>
               <td>
                    <select name="selc2">
                         <option>p
                         <option>m
                    </select>
               </td>
               <td>
                    <select name="selc3">
                         <option>4
                         <option>5
                    </select>
               </td>
               <td><input type="button" value="Split"
               onClick="javascript:bc_SplitTableRow(this);"></td>
          </tr>
     </table>
</body>
</html>
Have a look at this:

<html>
      <head>
            <title>Script Demo Gops</title>
            <script type="text/javascript">
                  function bc_SplitTableRow(theLink){
                        theRow = theLink.parentNode.parentNode;
                        theTable=theRow.parentNode;
                        newRow = theRow.cloneNode(true);
                        theRow.parentNode.insertBefore(newRow, theRow.nextSibling);

                        var newR=theRow.parentNode.rows.length-1;
                        for(i=0;i<theRow.cells.length;i++){
                              if(theRow.cells[i].childNodes[0].type=="select-one"){
                                    var parentSelect=theRow.cells[i].childNodes[0].selectedIndex;
                                    theTable.rows[newR].cells[i].childNodes[0].selectedIndex=parentSelect;
                              }
                        }
                        return false;
                  }
            </script>
      </head>
<body>
      <table border="0" cellspacing="2" cellpadding="2">
            <tr>
                  <td><input type="text" size="10" name="txt"></td>
                  <td>
                        <select name="selc1">
                              <option>A
                              <option>B
                        </select>
                  </td>
                  <td>
                        <select name="selc2">
                              <option>p
                              <option>m
                        </select>
                  </td>
                  <td>
                        <select name="selc3">
                              <option>4
                              <option>5
                        </select>
                  </td>
                  <td><input type="button" value="Split" onClick="javascript:bc_SplitTableRow(this);"></td>
          </tr>
     </table>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of gops1
gops1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gops1,

I tested the example and it works great!
BUT, I inserted it into my page and it doesn't work.... I played a bit with it put no luck...



<html>
     <head>
        <title>Script Demo Gops</title>
<body>
<script type="text/javascript">
function bc_SplitTableRow(theLink){
    theRow = theLink.parentNode.parentNode;
    theTable=theRow.parentNode;
    newRow = theRow.cloneNode(true);
    var newR=theRow.parentNode.insertBefore(newRow, theRow.nextSibling);

    for(i=0;i<theRow.cells.length;i++){
       if(theRow.cells[i].childNodes[0].type=="select-one"){
            var parentSelect=theRow.cells[i].childNodes[0].selectedIndex;
            theTable.rows[newR.rowIndex].cells[i].childNodes[0].selectedIndex=parentSelect;
       }
    }
    return false;
}

</script>
<table align="center" cellpadding="0" border="1" bordercolor="black" cellspacing="0" summary=""><tr><td></td></tr>
<tr>
<td><table cellpadding="0" border="0" cellspacing="0" summary="" class="t2standard">
<tr ><th id="CHECK$01" class="t2header"><label for="x01" class="hideMe508">Check All</label><input type="checkbox" name="x02" value="1" onclick="checkAll(this)" /></th><th id="START_DATE" class="t2header">Start Date</th><th id="BEGIN_TIME" class="t2header">Begin Time</th><th id="END_TIME" class="t2header">End Time</th><th id="SESSION_TITLE" class="t2header">Session Title</th><th id="ASSIGNED_RM" class="t2header">Assigned Rm</th><th id=" " class="t2header"> </th></tr>
<tr onmouseover="row_mouse_over8386918256913573(this, 1)" onmouseout="row_mouse_out8386918256913573(this, 1)"><td headers="CHECK$01" class="t2data"><label for="f01_0001" class="hideMe508">CHECK$01</label><input type="checkbox" name="f01" value="1" onclick="highlight_row(this,1)" id="f01_0001" /></td><td headers="START_DATE" class="t2data"><span class="lov"><input type="text" name="f04" size="15" maxlength="2000" value="29-NOV-2006"  style="padding-right:5px;" id="f04_0001" /><script type="text/javascript">
<!--

          function genCalf04_0()
     {
       elemArrLen = 0;
       if (document.forms[0].f04.length) {
         elemArrLen = document.forms[0].f04.length;
       }

       w = open("wwv_flow_utilities.show_as_popup_calendar" +
                   "?p_element_index=" + escape('f04'  + '['.substr(0,elemArrLen) +'0'.substr(0,elemArrLen) + ']'.substr(0,elemArrLen)) +
                   "&p_form_index=" + escape('0') +
                   "&p_date_format=" + escape('DD-MON-YYYY') +
                   "&p_application_format=" + escape('Y') +
                   "&p_bgcolor=" + escape('#666666') +
                   "&p_dd=" + escape('') +
                   "&p_hh=" + escape('') +
                   "&p_mi=" + escape('') +
                   "&p_pm=" + escape('') +
                   "&p_yyyy=" + escape('2006') +
                   "&p_lang=" + escape('en-us') +
                   "&p_mm=" + escape('11'),
                   "winLov",
                   "Scrollbars=no,resizable=no,width=258,height=210");

       if (w.opener == null)
         w.opener = self;
       w.focus();
     }
//-->
</script><a  href="javascript:genCalf04_0()"><img src="/i/asfdcldr.gif" align="middle" alt="Calendar"/></span></a></td><td headers="BEGIN_TIME" class="t2data"><label for="f05_0001" class="hideMe508">BEGIN_TIME</label><select name="f05"  id="f05_0001"><option value="">- Select -</option><option value="08:00" >8:00 AM</option><option value="08:30" >8:30 AM</option><option value="09:00" >9:00 AM</option><option value="09:30" >9:30 AM</option><option value="10:00" selected="selected">10:00 AM</option><option value="10:30" >10:30 AM</option><option value="11:00" >11:00 AM</option><option value="11:30" >11:30 AM</option><option value="12:00" >12:00 PM</option><option value="12:30" >12:30 PM</option><option value="13:00" >1:00 PM</option><option value="13:30" >1:30 PM</option><option value="14:00" >2:00 PM</option><option value="14:30" >2:30 PM</option><option value="15:00" >3:00 PM</option><option value="15:30" >3:30 PM</option><option value="16:00" >4:00 PM</option><option value="16:30" >4:30 PM</option><option value="17:00" >5:00 PM</option><option value="17:30" >5:30 PM</option><option value="18:00" >6:00 PM</option><option value="18:30" >6:30 PM</option><option value="19:00" >7:00 PM</option><option value="19:30" >7:30 PM</option><option value="20:00" >8:00 PM</option><option value="20:30" >8:30 PM</option><option value="21:00" >9:00 PM</option><option value="21:30" >9:30 PM</option><option value="22:00" >10:00 PM</option></select></td><td headers="END_TIME" class="t2data"><label for="f06_0001" class="hideMe508">END_TIME</label><select name="f06"  id="f06_0001"><option value="">- Select -</option><option value="08:00" >8:00 AM</option><option value="08:30" >8:30 AM</option><option value="09:00" >9:00 AM</option><option value="09:30" >9:30 AM</option><option value="10:00" selected="selected">10:00 AM</option><option value="10:30" >10:30 AM</option><option value="11:00" >11:00 AM</option><option value="11:30" >11:30 AM</option><option value="12:00" >12:00 PM</option><option value="12:30" >12:30 PM</option><option value="13:00" >1:00 PM</option><option value="13:30" >1:30 PM</option><option value="14:00" >2:00 PM</option><option value="14:30" >2:30 PM</option><option value="15:00" >3:00 PM</option><option value="15:30" >3:30 PM</option><option value="16:00" >4:00 PM</option><option value="16:30" >4:30 PM</option><option value="17:00" >5:00 PM</option><option value="17:30" >5:30 PM</option><option value="18:00" >6:00 PM</option><option value="18:30" >6:30 PM</option><option value="19:00" >7:00 PM</option><option value="19:30" >7:30 PM</option><option value="20:00" >8:00 PM</option><option value="20:30" >8:30 PM</option><option value="21:00" >9:00 PM</option><option value="21:30" >9:30 PM</option><option value="22:00" >10:00 PM</option></select></td><td headers="SESSION_TITLE" class="t2data"><label for="f08_0001" class="hideMe508">SESSION_TITLE</label><input type="text" name="f08" size="16" maxlength="2000" value="TEST20116633"  id="f08_0001" /></td><td headers="ASSIGNED_RM" class="t2data"><label for="f07_0001" class="hideMe508">ASSIGNED_RM</label><select name="f07"  id="f07_0001"><option value="">- Select -</option><option value="1" >Atascosa</option><option value="2" >Atascosa/Bandera</option><option value="3" >Atascosa/Bandera/Bexar</option><option value="4" >Atascosa/Bandera/Bexar/Dimmit</option><option value="5" >Atascosa/Bandera/Bexar/Dimmit/Frio</option><option value="6" >Atascosa/Bandera/Bexar/Dimmit/Frio/Kendal</option><option value="7" >Bandera</option><option value="8" >Bandera/Bexar</option><option value="9" selected="selected">Bandera/Bexar/Dimmit</option><option value="10" >Bandera/Bexar/Dimmit/Frio</option><option value="11" >Bandera/Bexar/Dimmit/Frio/Kendal</option><option value="12" >Bexar</option><option value="13" >Bexar/Dimmit</option><option value="14" >Bexar/Dimmit/Frio</option><option value="15" >Bexar/Dimmit/Frio/Kendal</option><option value="16" >Dimmit</option><option value="17" >Frio</option><option value="18" >Frio/Bexar</option><option value="19" >Frio/Bexar/Kendal</option><option value="20" >Frio/Kendall</option><option value="21" >Kendall</option><option value="22" >Kinney</option><option value="23" >Kinney/Kerr</option><option value="24" >Kerr</option><option value="25" >LaSalle</option><option value="26" >LaSalle/Medina</option><option value="27" >Medina</option><option value="28" >Maverick</option><option value="29" >Maverick/Real</option><option value="30" >Real</option><option value="31" >Wilson</option><option value="32" >Wilson/Zavala/Uvalde</option><option value="33" >Uvalde</option><option value="34" >Uvalde/Zavala</option><option value="35" >Zavala</option><option value="36" >Cedar</option><option value="37" >Cottonwood</option><option value="38" >Cypress</option><option value="39" >Elem</option><option value="40" >Hickory</option><option value="41" >Hickory/Laurel</option><option value="42" >Hickory/Laurel/Magnolia</option><option value="43" >Laurel</option><option value="44" >Laurel/Magnolia</option><option value="45" >Magnolia</option><option value="46" >Maple</option><option value="47" >Maple/Mesquite</option><option value="48" >Maple/Mesquite/Oak</option><option value="49" >Maple/Mesquite/Oak/Pecan</option><option value="50" >Mesquite</option><option value="51" >Mesquite/Oak</option><option value="52" >Mesquite/Oak/Pecan</option><option value="53" >Oak</option><option value="54" >Oak/Pecan</option><option value="55" >Pine</option><option value="56" >Redbud</option></select></td><td headers=" " class="t2data"><input type="BUTTON" value="Split" onClick="javascript:bc_SplitTableRow(this);"><input type="hidden" name="f02" value="1" /><input type="hidden" name="f03" value="2" /><input type="hidden" name="fcs" value="3AFE9BC73A08E37CE198929F0D1F250D" /></td></tr><tr onmouseover="row_mouse_over8386918256913573(this, 2)" onmouseout="row_mouse_out8386918256913573(this, 2)"><td headers="CHECK$01" class="t2data"><label for="f01_0002" class="hideMe508">CHECK$01</label><input type="checkbox" name="f01" value="2" onclick="highlight_row(this,2)" id="f01_0002" /></td><td headers="START_DATE" class="t2data"><span class="lov"><input type="text" name="f04" size="15" maxlength="2000" value="30-NOV-2006"  style="padding-right:5px;" id="f04_0002" /><script type="text/javascript">
<!--

          function genCalf04_1()
     {
       elemArrLen = 0;
       if (document.forms[0].f04.length) {
         elemArrLen = document.forms[0].f04.length;
       }

       w = open("wwv_flow_utilities.show_as_popup_calendar" +
                   "?p_element_index=" + escape('f04'  + '['.substr(0,elemArrLen) +'1'.substr(0,elemArrLen) + ']'.substr(0,elemArrLen)) +
                   "&p_form_index=" + escape('0') +
                   "&p_date_format=" + escape('DD-MON-YYYY') +
                   "&p_application_format=" + escape('Y') +
                   "&p_bgcolor=" + escape('#666666') +
                   "&p_dd=" + escape('') +
                   "&p_hh=" + escape('') +
                   "&p_mi=" + escape('') +
                   "&p_pm=" + escape('') +
                   "&p_yyyy=" + escape('2006') +
                   "&p_lang=" + escape('en-us') +
                   "&p_mm=" + escape('11'),
                   "winLov",
                   "Scrollbars=no,resizable=no,width=258,height=210");

       if (w.opener == null)
         w.opener = self;
       w.focus();
     }
//-->
</script><a  href="javascript:genCalf04_1()"><img src="/i/asfdcldr.gif" align="middle" alt="Calendar"/></span></a></td><td headers="BEGIN_TIME" class="t2data"><label for="f05_0002" class="hideMe508">BEGIN_TIME</label><select name="f05"  id="f05_0002"><option value="">- Select -</option><option value="08:00" >8:00 AM</option><option value="08:30" >8:30 AM</option><option value="09:00" >9:00 AM</option><option value="09:30" >9:30 AM</option><option value="10:00" >10:00 AM</option><option value="10:30" >10:30 AM</option><option value="11:00" >11:00 AM</option><option value="11:30" >11:30 AM</option><option value="12:00" >12:00 PM</option><option value="12:30" >12:30 PM</option><option value="13:00" >1:00 PM</option><option value="13:30" >1:30 PM</option><option value="14:00" >2:00 PM</option><option value="14:30" selected="selected">2:30 PM</option><option value="15:00" >3:00 PM</option><option value="15:30" >3:30 PM</option><option value="16:00" >4:00 PM</option><option value="16:30" >4:30 PM</option><option value="17:00" >5:00 PM</option><option value="17:30" >5:30 PM</option><option value="18:00" >6:00 PM</option><option value="18:30" >6:30 PM</option><option value="19:00" >7:00 PM</option><option value="19:30" >7:30 PM</option><option value="20:00" >8:00 PM</option><option value="20:30" >8:30 PM</option><option value="21:00" >9:00 PM</option><option value="21:30" >9:30 PM</option><option value="22:00" >10:00 PM</option></select></td><td headers="END_TIME" class="t2data"><label for="f06_0002" class="hideMe508">END_TIME</label><select name="f06"  id="f06_0002"><option value="">- Select -</option><option value="08:00" >8:00 AM</option><option value="08:30" >8:30 AM</option><option value="09:00" >9:00 AM</option><option value="09:30" >9:30 AM</option><option value="10:00" >10:00 AM</option><option value="10:30" >10:30 AM</option><option value="11:00" >11:00 AM</option><option value="11:30" >11:30 AM</option><option value="12:00" selected="selected">12:00 PM</option><option value="12:30" >12:30 PM</option><option value="13:00" >1:00 PM</option><option value="13:30" >1:30 PM</option><option value="14:00" >2:00 PM</option><option value="14:30" >2:30 PM</option><option value="15:00" >3:00 PM</option><option value="15:30" >3:30 PM</option><option value="16:00" >4:00 PM</option><option value="16:30" >4:30 PM</option><option value="17:00" >5:00 PM</option><option value="17:30" >5:30 PM</option><option value="18:00" >6:00 PM</option><option value="18:30" >6:30 PM</option><option value="19:00" >7:00 PM</option><option value="19:30" >7:30 PM</option><option value="20:00" >8:00 PM</option><option value="20:30" >8:30 PM</option><option value="21:00" >9:00 PM</option><option value="21:30" >9:30 PM</option><option value="22:00" >10:00 PM</option></select></td><td headers="SESSION_TITLE" class="t2data"><label for="f08_0002" class="hideMe508">SESSION_TITLE</label><input type="text" name="f08" size="16" maxlength="2000" value="test1122"  id="f08_0002" /></td><td headers="ASSIGNED_RM" class="t2data"><label for="f07_0002" class="hideMe508">ASSIGNED_RM</label><select name="f07"  id="f07_0002"><option value="">- Select -</option><option value="1" >Atascosa</option><option value="2" >Atascosa/Bandera</option><option value="3" >Atascosa/Bandera/Bexar</option><option value="4" >Atascosa/Bandera/Bexar/Dimmit</option><option value="5" >Atascosa/Bandera/Bexar/Dimmit/Frio</option><option value="6" >Atascosa/Bandera/Bexar/Dimmit/Frio/Kendal</option><option value="7" >Bandera</option><option value="8" >Bandera/Bexar</option><option value="9" selected="selected">Bandera/Bexar/Dimmit</option><option value="10" >Bandera/Bexar/Dimmit/Frio</option><option value="11" >Bandera/Bexar/Dimmit/Frio/Kendal</option><option value="12" >Bexar</option><option value="13" >Bexar/Dimmit</option><option value="14" >Bexar/Dimmit/Frio</option><option value="15" >Bexar/Dimmit/Frio/Kendal</option><option value="16" >Dimmit</option><option value="17" >Frio</option><option value="18" >Frio/Bexar</option><option value="19" >Frio/Bexar/Kendal</option><option value="20" >Frio/Kendall</option><option value="21" >Kendall</option><option value="22" >Kinney</option><option value="23" >Kinney/Kerr</option><option value="24" >Kerr</option><option value="25" >LaSalle</option><option value="26" >LaSalle/Medina</option><option value="27" >Medina</option><option value="28" >Maverick</option><option value="29" >Maverick/Real</option><option value="30" >Real</option><option value="31" >Wilson</option><option value="32" >Wilson/Zavala/Uvalde</option><option value="33" >Uvalde</option><option value="34" >Uvalde/Zavala</option><option value="35" >Zavala</option><option value="36" >Cedar</option><option value="37" >Cottonwood</option><option value="38" >Cypress</option><option value="39" >Elem</option><option value="40" >Hickory</option><option value="41" >Hickory/Laurel</option><option value="42" >Hickory/Laurel/Magnolia</option><option value="43" >Laurel</option><option value="44" >Laurel/Magnolia</option><option value="45" >Magnolia</option><option value="46" >Maple</option><option value="47" >Maple/Mesquite</option><option value="48" >Maple/Mesquite/Oak</option><option value="49" >Maple/Mesquite/Oak/Pecan</option><option value="50" >Mesquite</option><option value="51" >Mesquite/Oak</option><option value="52" >Mesquite/Oak/Pecan</option><option value="53" >Oak</option><option value="54" >Oak/Pecan</option><option value="55" >Pine</option><option value="56" >Redbud</option></select></td><td headers=" " class="t2data"><input type="BUTTON" value="Split" onClick="javascript:bc_SplitTableRow(this);"><input type="hidden" name="f02" value="2" /><input type="hidden" name="f03" value="2" /><input type="hidden" name="fcs" value="1AD5B4D9FFCAF5403ECEFC205A82CAE0" /></td></tr></table><div class="t2CVS"></div></td>
</tr>
<tr><td colspan="10" align="right" ><table summary=""><tr><td class="pagination"></td><td class="pagination"></td><td nowrap="nowrap" class="pagination"><span class="fielddata">1 - 2</span></td><td class="pagination"></td><td class="pagination"></td></tr></table></td></tr>
</table>
</body>
</html>
Gops1,

I just realized! Your example doesn't use the VALUE

<select name="selc1">
 <option>A
 <option>B
</select>

<select name="selc1">
<option value="26" >LaSalle/Medina</option>
<option value="27" >Medina</option>
<option value="28" >Maverick</option>
<option value="29" >Maverick/Real</option>
<option value="30" >Real</option
</select>



I reduced the example of my page down to 3 selects ...  and it is not working...


<html>
     <head>
        <title>Script Demo Gops</title>
        <head>
             <script type="text/javascript">
function bc_SplitTableRow(theLink){
    theRow = theLink.parentNode.parentNode;
    theTable=theRow.parentNode;
    newRow = theRow.cloneNode(true);
    var newR=theRow.parentNode.insertBefore(newRow, theRow.nextSibling);

    for(i=0;i<theRow.cells.length;i++){
      if(theRow.cells[i].childNodes[0].type=="select-one"){
           var parentSelect=theRow.cells[i].childNodes[0].selectedIndex;
           theTable.rows[newR.rowIndex].cells[i].childNodes[0].selectedIndex=parentSelect;
      }
    }
    return false;
}
             </script>
        </head>
<body>
     <table border="0" cellspacing="2" cellpadding="2">
        <tr>
             <td><input type="text" size="10" name="txt"></td>

<td headers="ASSIGNED_RM1" class="t2data">
<label for="f07_0001" class="hideMe508">ASSIGNED_RM</label>
<select name="f07" id="f07_0001">
<option value="">- Select -</option>
<option value="1" >Atascosa</option>
<option value="2" >Atascosa/Bandera</option>
<option value="3" >Atascosa/Bandera/Bexar</option>
<option value="4" >Atascosa/Bandera/Bexar/Dimmit</option>
<option value="5" >Atascosa/Bandera/Bexar/Dimmit/Frio</option>
<option value="6" >Atascosa/Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bandera/Bexar/Dimmit</option>
<option value="10" >Bandera/Bexar/Dimmit/Frio</option>
<option value="11" >Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="12" >Bexar</option>
<option value="13" >Bexar/Dimmit</option>
<option value="14" >Bexar/Dimmit/Frio</option>
<option value="15" >Bexar/Dimmit/Frio/Kendal</option>
<option value="16" >Dimmit</option>
<option value="17" >Frio</option>
<option value="18" >Frio/Bexar</option>
<option value="19" >Frio/Bexar/Kendal</option>
<option value="20" >Frio/Kendall</option>
<option value="21" >Kendall</option>
<option value="22" >Kinney</option>
<option value="23" >Kinney/Kerr</option>
<option value="24" >Kerr</option>
<option value="25" >LaSalle</option>
<option value="26" >LaSalle/Medina</option>
<option value="56" >Redbud</option>
</select>
</td>
<td headers="ASSIGNED_RM2" class="t2data">
<label for="f07_0002" class="hideMe508">ASSIGNED_RM</label>
<select name="f07" id="f07_0002">
<option value="">- Select -</option>
<option value="1" >Atascosa</option>
<option value="2" >Atascosa/Bandera</option>
<option value="3" >Atascosa/Bandera/Bexar</option>
<option value="4" >Atascosa/Bandera/Bexar/Dimmit</option>
<option value="5" >Atascosa/Bandera/Bexar/Dimmit/Frio</option>
<option value="6" >Atascosa/Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bandera/Bexar/Dimmit</option>
<option value="10" >Bandera/Bexar/Dimmit/Frio</option>
<option value="11" >Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="12" >Bexar</option>
<option value="13" >Bexar/Dimmit</option>
<option value="14" >Bexar/Dimmit/Frio</option>
<option value="15" >Bexar/Dimmit/Frio/Kendal</option>
<option value="16" >Dimmit</option>
<option value="17" >Frio</option>
<option value="18" >Frio/Bexar</option>
<option value="19" >Frio/Bexar/Kendal</option>
<option value="20" >Frio/Kendall</option>
<option value="21" >Kendall</option>
<option value="22" >Kinney</option>
<option value="23" >Kinney/Kerr</option>
<option value="24" >Kerr</option>
<option value="25" >LaSalle</option>
<option value="26" >LaSalle/Medina</option>
<option value="56" >Redbud</option>
</select>
</td>
<td headers="ASSIGNED_RM3" class="t2data">
<label for="f07_0003" class="hideMe508">ASSIGNED_RM</label>
<select name="f07" id="f07_0003">
<option value="">- Select -</option>
<option value="1" >Atascosa</option>
<option value="2" >Atascosa/Bandera</option>
<option value="3" >Atascosa/Bandera/Bexar</option>
<option value="4" >Atascosa/Bandera/Bexar/Dimmit</option>
<option value="5" >Atascosa/Bandera/Bexar/Dimmit/Frio</option>
<option value="6" >Atascosa/Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bandera/Bexar/Dimmit</option>
<option value="10" >Bandera/Bexar/Dimmit/Frio</option>
<option value="11" >Bandera/Bexar/Dimmit/Frio/Kendal</option>
<option value="12" >Bexar</option>
<option value="13" >Bexar/Dimmit</option>
<option value="14" >Bexar/Dimmit/Frio</option>
<option value="15" >Bexar/Dimmit/Frio/Kendal</option>
<option value="16" >Dimmit</option>
<option value="17" >Frio</option>
<option value="18" >Frio/Bexar</option>
<option value="19" >Frio/Bexar/Kendal</option>
<option value="20" >Frio/Kendall</option>
<option value="21" >Kendall</option>
<option value="22" >Kinney</option>
<option value="23" >Kinney/Kerr</option>
<option value="24" >Kerr</option>
<option value="25" >LaSalle</option>
<option value="26" >LaSalle/Medina</option>
<option value="56" >Redbud</option>
</select>
</td>
             <td><input type="button" value="Split" onClick="javascript:bc_SplitTableRow(this);"></td>
        </tr>
     </table>
</body>
</html>

This works fine... but not the above???

<html>
     <head>
        <title>Script Demo Gops</title>
        <head>
             <script type="text/javascript">
function bc_SplitTableRow(theLink){
    theRow = theLink.parentNode.parentNode;
    theTable=theRow.parentNode;
    newRow = theRow.cloneNode(true);
    var newR=theRow.parentNode.insertBefore(newRow, theRow.nextSibling);

    for(i=0;i<theRow.cells.length;i++){
      if(theRow.cells[i].childNodes[0].type=="select-one"){
           var parentSelect=theRow.cells[i].childNodes[0].selectedIndex;
           theTable.rows[newR.rowIndex].cells[i].childNodes[0].selectedIndex=parentSelect;
      }
    }
    return false;
}
             </script>
        </head>
<body>
     <table border="0" cellspacing="2" cellpadding="2">
        <tr>
             <td><input type="text" size="10" name="txt"></td>
             <td>
                <select name="selc1">
<option value="26" >LaSalle/Medina</option>
<option value="27" >Medina</option>
<option value="28" >Maverick</option>
<option value="29" >Maverick/Real</option>
<option value="30" >Real</option>
</select>
             </td>
             <td>
                <select name="selc2">
<option value="26" >LaSalle/Medina</option>
<option value="27" >Medina</option>
<option value="28" >Maverick</option>
<option value="29" >Maverick/Real</option>
<option value="30" >Real</option>
</select>
             </td>
             <td>
                <select name="selc3">
<option value="26" >LaSalle/Medina</option>
<option value="27" >Medina</option>
<option value="28" >Maverick</option>
<option value="29" >Maverick/Real</option>
<option value="30" >Real</option>
                </select>
             </td>
             <td><input type="button" value="Split" onClick="javascript:bc_SplitTableRow(this);"></td>
        </tr>
     </table>
</body>
</html>
Gops1,

I took the <label for="f07_0003" class="hideMe508">ASSIGNED_RM</label>
off each select and it works fine..

I am using Oracle Application Express and don't know where that comes from.... any ideas?

Thank you, Bill


Gops1,

On Mozilla it works fine...

I have Oracle looking into it...

Thanks for all your help! Bill