以上图为例,点击“增加行”按钮会增加一行
function addNew()
{
var m1=0;
m1=parseInt(document.all.linenumber1.value);
n=m1+2;
tr=document.all.t136.insertRow();
tr.height=25;
with(tr.insertCell())
{
innerHTML='<input id="wpmc'+m1+'" name="wpmc'+m1+'"><br>';
width='170';align='center';}
with(tr.insertCell())
{
innerHTML='<select id="ggxh'+m1+'" name="ggxh'+m1+'"></select>;
width='130';align='center';}
with(tr.insertCell())
{
innerHTML='<input type=text name="jldw'+m1+'">';
width='70';align='center';}
with(tr.insertCell())
{
innerHTML='<input type=text name="zhijian'+m1+'" style="border=0; text-align:center;width:50" readonly >;
width='70';align='center';}
with(tr.insertCell())
{
innerHTML='<input type="text" id="shliang'+m1+'" name="shliang">';
width='125';align='right';}
with(tr.insertCell())
{
innerHTML='<input type="text" id="hsdj'+m1+'" name="hsdj">';
width='140';align='right';}
with(tr.insertCell())
{
innerHTML='<input type="text" id="zjiner'+m1+'" name="zjiner">';
width='140';align='right';}
with(tr.insertCell())
{
innerHTML='<input type="button" id="shanchu'+m1+'" name="shanchu" onclick=del() value="删">';
width='35';align='center';}
m1++;
b=document.getElementById("t136").rows.length-1;
document.all.linenumber.value=b;
document.all.linenumber1.value=m1;
}
随缘不变,不变随缘