批量输入数据的可输入表格,类似VB中的datagrid

qgbin 2010-03-18 01:37:40
在WEB的客户端批量输入数据的可输入表格,类似VB中的datagrid,如:

编号 名称 产地 数量
在编号处输入字符后调出品种,跳到数量.再输入数据增加一行.有源码最好
...全文
77 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
shan1119 2010-03-18
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script type="text/jscript">
var codeList={1:"A",
2:"B",
3:"C"};
window.onload=function(){
setBound();
}
function setBound(){
var input=document.getElementsByTagName("input");
for(var i=0;i<input.length;i++){
if(i%4==0){
input[i].onclick=function(){};
input[i].onblur=function(){
if(this.value=="")return;
this.parentNode.parentNode.childNodes[1].childNodes[0].value=codeList[this.value];
this.parentNode.parentNode.childNodes[3].childNodes[0].focus();
};
}else if(i%4==3){
//check ...insert new row...
}
}
}
</script>
</head>
<body>
<table border=1>
<tr><th>code</th><th>name</th><th>place</th><th>account</th></tr>
<tr><td><input></td><td><input></td><td><input></td><td><input></td></tr>
</table>
</body>
</html>

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧