<script>
function hideList(obj_id,img)
{
var obj=document.getElementById(obj_id);
if(obj.style.display=="none")
{
obj.style.display="";
if(img!=null)
img.src=img.src.replace("hide_b.gif","expand_b.gif");
}else
{
obj.style.display="none";
if(img!=null)
img.src=img.src.replace("expand_b.gif","hide_b.gif");
}
}
function addRow(){
var table=document.getElementById("content_table_left");
var tr=table.getElementsByTagName("tr");
var rowN=tr.length-1;
tableRow=table.insertRow();
tableRow.style.background="white";
tableCell1=tableRow.insertCell(0);
tableCell2=tableRow.insertCell(0);
tableCell3=tableRow.insertCell(0);
tableCell1.align="center";
tableCell1.innerHTML="<input type='hidden' name='supplyList["+rowN+"].enabled'/><input type='hidden' name='supplyList["+rowN+"].changeFlag' id='supplyList["+rowN+"].changeFlag'/><input type='hidden' name='supplyList["+rowN+"].isAdd' id='supplyList["+rowN+"].isAdd'/><input type='checkbox' class='noBorder' checked='checked' οnchange='changeCheckBox(this);changeAddRow(this)'/>";
tableCell2.innerHTML="<input type='text' name='supplyList["+rowN+"].description' οnchange='changeAddRow(this);' />";
tableCell3.innerHTML="<input type='text' name='supplyList["+rowN+"].supplyCenterCode' οnchange='changeAddRow(this);' />";
}
</script>
<html>
<title>test add row</title>
<body>
<div class="c_title_layout"><span><img
src="<app:ContextPath/>/images/expand_b.gif"
οnclick="hideList('searchCondition',this);"
width="16" eight="16" align="absbottom"> Search Conditions</span></div>
<DIV class="gap10px"></div>
<div id="searchCondition">
<table width="100%" border="0" align="center" cellpadding="1"
cellspacing="1" class="input_data_table">
<tr class="bg_white">
<td class="input_data_table_td">Supply Center. <span
style="color:#FF0000;">*</span></td>
<td><input id="inputSearchSupplyCenterCode" name="inputSearchSupplyCenterCode" type="text" value=""/>
</td>
</tr>
</table>
<DIV class="gap10px"></div>
<div style="text-align: center">
<input type="hidden" id="backSearchCondition"/>
<input name="search"
type="button" class="button" value="Search" οnclick="validateNull();" id="searchId"/>
<input name="clear" type="button" class="button"
value="Clear" οnclick="clearInfo();" />
</div>
</div>
<div id="resultList">
<input class="button" type="button"
οnclick="addRow();" value=" Add "
id="addButton"/>
<input type="button" class="button" value=" Save " id="saveSubmit"
οnclick="saveSubmit1();"/>
</div>
<table width="100%" border="0" cellpadding="1" cellspacing="1"
id="content_table_left" class="list_data_table">
<tr align="left">
<td class="input_data_table_td" align="left">
<strong>Field1 test1</strong>
</td>
<td class="input_data_table_td" align="left">
<strong>Field2 test2</strong>
</td>
<td class="input_data_table_td" align="center">
<strong>Enabled</strong>
</td>
</tr>
</table>
</body>
function hideList(obj_id,img)
{
var obj=document.getElementById(obj_id);
if(obj.style.display=="none")
{
obj.style.display="";
if(img!=null)
img.src=img.src.replace("hide_b.gif","expand_b.gif");
}else
{
obj.style.display="none";
if(img!=null)
img.src=img.src.replace("expand_b.gif","hide_b.gif");
}
}
function addRow(){
var table=document.getElementById("content_table_left");
var tr=table.getElementsByTagName("tr");
var rowN=tr.length-1;
tableRow=table.insertRow();
tableRow.style.background="white";
tableCell1=tableRow.insertCell(0);
tableCell2=tableRow.insertCell(0);
tableCell3=tableRow.insertCell(0);
tableCell1.align="center";
tableCell1.innerHTML="<input type='hidden' name='supplyList["+rowN+"].enabled'/><input type='hidden' name='supplyList["+rowN+"].changeFlag' id='supplyList["+rowN+"].changeFlag'/><input type='hidden' name='supplyList["+rowN+"].isAdd' id='supplyList["+rowN+"].isAdd'/><input type='checkbox' class='noBorder' checked='checked' οnchange='changeCheckBox(this);changeAddRow(this)'/>";
tableCell2.innerHTML="<input type='text' name='supplyList["+rowN+"].description' οnchange='changeAddRow(this);' />";
tableCell3.innerHTML="<input type='text' name='supplyList["+rowN+"].supplyCenterCode' οnchange='changeAddRow(this);' />";
}
</script>
<html>
<title>test add row</title>
<body>
<div class="c_title_layout"><span><img
src="<app:ContextPath/>/images/expand_b.gif"
οnclick="hideList('searchCondition',this);"
width="16" eight="16" align="absbottom"> Search Conditions</span></div>
<DIV class="gap10px"></div>
<div id="searchCondition">
<table width="100%" border="0" align="center" cellpadding="1"
cellspacing="1" class="input_data_table">
<tr class="bg_white">
<td class="input_data_table_td">Supply Center. <span
style="color:#FF0000;">*</span></td>
<td><input id="inputSearchSupplyCenterCode" name="inputSearchSupplyCenterCode" type="text" value=""/>
</td>
</tr>
</table>
<DIV class="gap10px"></div>
<div style="text-align: center">
<input type="hidden" id="backSearchCondition"/>
<input name="search"
type="button" class="button" value="Search" οnclick="validateNull();" id="searchId"/>
<input name="clear" type="button" class="button"
value="Clear" οnclick="clearInfo();" />
</div>
</div>
<div id="resultList">
<input class="button" type="button"
οnclick="addRow();" value=" Add "
id="addButton"/>
<input type="button" class="button" value=" Save " id="saveSubmit"
οnclick="saveSubmit1();"/>
</div>
<table width="100%" border="0" cellpadding="1" cellspacing="1"
id="content_table_left" class="list_data_table">
<tr align="left">
<td class="input_data_table_td" align="left">
<strong>Field1 test1</strong>
</td>
<td class="input_data_table_td" align="left">
<strong>Field2 test2</strong>
</td>
<td class="input_data_table_td" align="center">
<strong>Enabled</strong>
</td>
</tr>
</table>
</body>