var lengths;
function insertrow2() //增加的一行方法2
{
newRow=document.all.yltable.insertRow(-1);
lengths = document.all.yltable.rows.length;
newcell=newRow.insertCell() ; newRow.bgColor='#FFFFFF'; newcell.align='center'; newcell.innerHTML='<input name="button3" type="button" onClick="delrow1()" value="删除1"> '; newcell=newRow.insertCell() ; newRow.bgColor='#FFFFFF'; newcell.align='center'; newcell.innerHTML="<input type='text' id='name"+lengths+"' name='ylText"+lengths+"' />"; newcell=newRow.insertCell() ; newRow.bgColor='#FFFFFF'; newcell.align='center'; newcell.innerHTML="<input type='text' id='sex"+lengths+"' name='ylText"+lengths+"' />"; newcell=newRow.insertCell() ; newRow.bgColor='#FFFFFF'; newcell.align='center'; newcell.innerHTML="<input type='text' name='age"+lengths+"' />"; newcell=newRow.insertCell() ; newRow.bgColor='#FFFFFF'; newcell.align='center'; newcell.innerHTML="<input type='text' name='no"+lengths+"' />"; var a ="'name"+lengths+"'"; b = "name"+String(lengths); alert(b); var v = document.getElementById(b).value; alert(v); document.all.yltable.focus();
}
function inserttable()
{
var newnode = document.getElementById('yltable').cloneNode(true);
document.getElementById('ylform').appendChild(newnode);
}
function getValues(){
//通过这个方法可以取到动态table中输入的值,怎么能够通过button的提交,把该值传到后台处理?
b = "name"+String(lengths);
var address = document.getElementById(b).value;
alert(address);
//怎么把获取到的address 传到java后台呢?
}
白衣染霜花
相关分类