BILL Carlisle
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_Spl itTableRow (this);">' " "
<script>
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN ode;
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe fore(newRo w, 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?
I have the following that is called from a button in the row to be cloned.
'<input type="BUTTON" value="Split" onClick="javascript:bc_Spl
<script>
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe
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?
ASKER
R.K.
That is adding files and couldn't see clearly where it clones select lists... ???
Thank you Bill
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.parentN ode;
theTable=theRow.parentNode ;
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe fore(newRo w, theRow.nextSibling);
var parentSelect=theRow.cells[ 1].childNo des[0].sel ectedIndex ;
var newR=theRow.parentNode.row s.length-1 ;
theTable.rows[newR].cells[ 1].childNo des[0].sel ectedIndex =parentSel ect;
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_Spl itTableRow (this);">< /td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>Script Demo Gops</title>
<head>
<script type="text/javascript">
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe
var parentSelect=theRow.cells[
var newR=theRow.parentNode.row
theTable.rows[newR].cells[
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_Spl
</tr>
</table>
</body>
</html>
ASKER
Hi Gosp1,
I tried the below and it still didn't clone the selects.
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN ode;
theTable=theRow.parentNode ;
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe fore(newRo w, theRow.nextSibling);
var parentSelect=theRow.cells[ 1].childNo des[0].sel ectedIndex ;
var newR=theRow.parentNode.row s.length-1 ;
theTable.rows[newR].cells[ 1].childNo des[0].sel ectedIndex =parentSel ect;
return false;
}
Bill
I tried the below and it still didn't clone the selects.
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe
var parentSelect=theRow.cells[
var newR=theRow.parentNode.row
theTable.rows[newR].cells[
return false;
}
Bill
Not a problem Bill, I need to see your table structure and find a fix for it.
ASKER
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.parentN ode;
theTable=theRow.parentNode ;
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe fore(newRo w, theRow.nextSibling);
var parentSelect=theRow.cells[ 1].childNo des[0].sel ectedIndex ;
var newR=theRow.parentNode.row s.length-1 ;
theTable.rows[newR].cells[ 1].childNo des[0].sel ectedIndex =parentSel ect;
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_Spl itTableRow (this);">< /td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>Script Demo Gops</title>
<head>
<script type="text/javascript">
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe
var parentSelect=theRow.cells[
var newR=theRow.parentNode.row
theTable.rows[newR].cells[
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_Spl
</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.parentN ode;
theTable=theRow.parentNode ;
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe fore(newRo w, theRow.nextSibling);
var newR=theRow.parentNode.row s.length-1 ;
for(i=0;i<theRow.cells.len gth;i++){
if(theRow.cells[i].childNo des[0].typ e=="select -one"){
var parentSelect=theRow.cells[ i].childNo des[0].sel ectedIndex ;
theTable.rows[newR].cells[ i].childNo des[0].sel ectedIndex =parentSel ect;
}
}
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_Spl itTableRow (this);">< /td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>Script Demo Gops</title>
<script type="text/javascript">
function bc_SplitTableRow(theLink){
theRow = theLink.parentNode.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
theRow.parentNode.insertBe
var newR=theRow.parentNode.row
for(i=0;i<theRow.cells.len
if(theRow.cells[i].childNo
var parentSelect=theRow.cells[
theTable.rows[newR].cells[
}
}
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_Spl
</tr>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.parentN ode;
theTable=theRow.parentNode ;
newRow = theRow.cloneNode(true);
var newR=theRow.parentNode.ins ertBefore( newRow, theRow.nextSibling);
for(i=0;i<theRow.cells.len gth;i++){
if(theRow.cells[i].childNo des[0].typ e=="select -one"){
var parentSelect=theRow.cells[ i].childNo des[0].sel ectedIndex ;
theTable.rows[newR.rowInde x].cells[i ].childNod es[0].sele ctedIndex= parentSele ct;
}
}
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_ove r838691825 6913573(th is, 1)" onmouseout="row_mouse_out8 3869182569 13573(this , 1)"><td headers="CHECK$01" class="t2data"><label for="f01_0001" class="hideMe508">CHECK$01 </label><i nput type="checkbox" name="f01" value="1" onclick="highlight_row(thi s,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.len gth) {
elemArrLen = document.forms[0].f04.leng th;
}
w = open("wwv_flow_utilities.s how_as_pop up_calenda r" +
"?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=n o,width=25 8,height=2 10");
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_TI ME</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><s elect 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</lab el><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</o ption><opt ion value="4" >Atascosa/Bandera/Bexar/Di mmit</opti on><option value="5" >Atascosa/Bandera/Bexar/Di mmit/Frio< /option><o ption value="6" >Atascosa/Bandera/Bexar/Di mmit/Frio/ Kendal</op tion><opti on value="7" >Bandera</option><option value="8" >Bandera/Bexar</option><op tion value="9" selected="selected">Bander a/Bexar/Di mmit</opti on><option value="10" >Bandera/Bexar/Dimmit/Frio </option>< option value="11" >Bandera/Bexar/Dimmit/Frio /Kendal</o ption><opt ion value="12" >Bexar</option><option value="13" >Bexar/Dimmit</option><opt ion value="14" >Bexar/Dimmit/Frio</option ><option value="15" >Bexar/Dimmit/Frio/Kendal< /option><o ption value="16" >Dimmit</option><option value="17" >Frio</option><option value="18" >Frio/Bexar</option><optio n value="19" >Frio/Bexar/Kendal</option ><option value="20" >Frio/Kendall</option><opt ion value="21" >Kendall</option><option value="22" >Kinney</option><option value="23" >Kinney/Kerr</option><opti on value="24" >Kerr</option><option value="25" >LaSalle</option><option value="26" >LaSalle/Medina</option><o ption value="27" >Medina</option><option value="28" >Maverick</option><option value="29" >Maverick/Real</option><op tion value="30" >Real</option><option value="31" >Wilson</option><option value="32" >Wilson/Zavala/Uvalde</opt ion><optio n value="33" >Uvalde</option><option value="34" >Uvalde/Zavala</option><op tion value="35" >Zavala</option><option value="36" >Cedar</option><option value="37" >Cottonwood</option><optio n value="38" >Cypress</option><option value="39" >Elem</option><option value="40" >Hickory</option><option value="41" >Hickory/Laurel</option><o ption value="42" >Hickory/Laurel/Magnolia</ option><op tion 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><o ption value="48" >Maple/Mesquite/Oak</optio n><option value="49" >Maple/Mesquite/Oak/Pecan< /option><o ption value="50" >Mesquite</option><option value="51" >Mesquite/Oak</option><opt ion value="52" >Mesquite/Oak/Pecan</optio n><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_Spl itTableRow (this);">< input type="hidden" name="f02" value="1" /><input type="hidden" name="f03" value="2" /><input type="hidden" name="fcs" value="3AFE9BC73A08E37CE19 8929F0D1F2 50D" /></td></tr><tr onmouseover="row_mouse_ove r838691825 6913573(th is, 2)" onmouseout="row_mouse_out8 3869182569 13573(this , 2)"><td headers="CHECK$01" class="t2data"><label for="f01_0002" class="hideMe508">CHECK$01 </label><i nput type="checkbox" name="f01" value="2" onclick="highlight_row(thi s,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.len gth) {
elemArrLen = document.forms[0].f04.leng th;
}
w = open("wwv_flow_utilities.s how_as_pop up_calenda r" +
"?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=n o,width=25 8,height=2 10");
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_TI ME</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><s elect 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</lab el><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</o ption><opt ion value="4" >Atascosa/Bandera/Bexar/Di mmit</opti on><option value="5" >Atascosa/Bandera/Bexar/Di mmit/Frio< /option><o ption value="6" >Atascosa/Bandera/Bexar/Di mmit/Frio/ Kendal</op tion><opti on value="7" >Bandera</option><option value="8" >Bandera/Bexar</option><op tion value="9" selected="selected">Bander a/Bexar/Di mmit</opti on><option value="10" >Bandera/Bexar/Dimmit/Frio </option>< option value="11" >Bandera/Bexar/Dimmit/Frio /Kendal</o ption><opt ion value="12" >Bexar</option><option value="13" >Bexar/Dimmit</option><opt ion value="14" >Bexar/Dimmit/Frio</option ><option value="15" >Bexar/Dimmit/Frio/Kendal< /option><o ption value="16" >Dimmit</option><option value="17" >Frio</option><option value="18" >Frio/Bexar</option><optio n value="19" >Frio/Bexar/Kendal</option ><option value="20" >Frio/Kendall</option><opt ion value="21" >Kendall</option><option value="22" >Kinney</option><option value="23" >Kinney/Kerr</option><opti on value="24" >Kerr</option><option value="25" >LaSalle</option><option value="26" >LaSalle/Medina</option><o ption value="27" >Medina</option><option value="28" >Maverick</option><option value="29" >Maverick/Real</option><op tion value="30" >Real</option><option value="31" >Wilson</option><option value="32" >Wilson/Zavala/Uvalde</opt ion><optio n value="33" >Uvalde</option><option value="34" >Uvalde/Zavala</option><op tion value="35" >Zavala</option><option value="36" >Cedar</option><option value="37" >Cottonwood</option><optio n value="38" >Cypress</option><option value="39" >Elem</option><option value="40" >Hickory</option><option value="41" >Hickory/Laurel</option><o ption value="42" >Hickory/Laurel/Magnolia</ option><op tion 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><o ption value="48" >Maple/Mesquite/Oak</optio n><option value="49" >Maple/Mesquite/Oak/Pecan< /option><o ption value="50" >Mesquite</option><option value="51" >Mesquite/Oak</option><opt ion value="52" >Mesquite/Oak/Pecan</optio n><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_Spl itTableRow (this);">< input type="hidden" name="f02" value="2" /><input type="hidden" name="f03" value="2" /><input type="hidden" name="fcs" value="1AD5B4D9FFCAF5403EC EFC205A82C AE0" /></td></tr></table><div class="t2CVS"></div></td>
</tr>
<tr><td colspan="10" align="right" ><table summary=""><tr><td class="pagination"></td><t d class="pagination"></td><t d nowrap="nowrap" class="pagination"><span class="fielddata">1 - 2</span></td><td class="pagination"></td><t d class="pagination"></td></ tr></table ></td></tr >
</table>
</body>
</html>
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.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
var newR=theRow.parentNode.ins
for(i=0;i<theRow.cells.len
if(theRow.cells[i].childNo
var parentSelect=theRow.cells[
theTable.rows[newR.rowInde
}
}
return false;
}
</script>
<table align="center" cellpadding="0" border="1" bordercolor="black" cellspacing="0" summary=""><tr><td></td></
<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_ove
<!--
function genCalf04_0()
{
elemArrLen = 0;
if (document.forms[0].f04.len
elemArrLen = document.forms[0].f04.leng
}
w = open("wwv_flow_utilities.s
"?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=n
if (w.opener == null)
w.opener = self;
w.focus();
}
//-->
</script><a href="javascript:genCalf04
<!--
function genCalf04_1()
{
elemArrLen = 0;
if (document.forms[0].f04.len
elemArrLen = document.forms[0].f04.leng
}
w = open("wwv_flow_utilities.s
"?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=n
if (w.opener == null)
w.opener = self;
w.focus();
}
//-->
</script><a href="javascript:genCalf04
</tr>
<tr><td colspan="10" align="right" ><table summary=""><tr><td class="pagination"></td><t
</table>
</body>
</html>
ASKER
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 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>
ASKER
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.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
var newR=theRow.parentNode.ins
for(i=0;i<theRow.cells.len
if(theRow.cells[i].childNo
var parentSelect=theRow.cells[
theTable.rows[newR.rowInde
}
}
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
<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</o
<option value="4" >Atascosa/Bandera/Bexar/Di
<option value="5" >Atascosa/Bandera/Bexar/Di
<option value="6" >Atascosa/Bandera/Bexar/Di
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bander
<option value="10" >Bandera/Bexar/Dimmit/Frio
<option value="11" >Bandera/Bexar/Dimmit/Frio
<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 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
<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</o
<option value="4" >Atascosa/Bandera/Bexar/Di
<option value="5" >Atascosa/Bandera/Bexar/Di
<option value="6" >Atascosa/Bandera/Bexar/Di
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bander
<option value="10" >Bandera/Bexar/Dimmit/Frio
<option value="11" >Bandera/Bexar/Dimmit/Frio
<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 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
<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</o
<option value="4" >Atascosa/Bandera/Bexar/Di
<option value="5" >Atascosa/Bandera/Bexar/Di
<option value="6" >Atascosa/Bandera/Bexar/Di
<option value="7" >Bandera</option>
<option value="8" >Bandera/Bexar</option>
<option value="9" selected="selected">Bander
<option value="10" >Bandera/Bexar/Dimmit/Frio
<option value="11" >Bandera/Bexar/Dimmit/Frio
<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 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_Spl
</tr>
</table>
</body>
</html>
ASKER
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.parentN
theTable=theRow.parentNode
newRow = theRow.cloneNode(true);
var newR=theRow.parentNode.ins
for(i=0;i<theRow.cells.len
if(theRow.cells[i].childNo
var parentSelect=theRow.cells[
theTable.rows[newR.rowInde
}
}
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_Spl
</tr>
</table>
</body>
</html>
ASKER
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
I took the <label for="f07_0003" class="hideMe508">ASSIGNED
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
ASKER
Gops1,
On Mozilla it works fine...
I have Oracle looking into it...
Thanks for all your help! Bill
On Mozilla it works fine...
I have Oracle looking into it...
Thanks for all your help! Bill
look at here...
https://www.experts-exchange.com/questions/21285346/Dynamic-elements-addition-problem.html
R.K