<!--
var count = 1;function addItem(){
count = count + 1;
var e=window.event.srcElement;
var tr1=e.parentElement.parentElement;
var tr2=mainTable.insertRow();
tr2.className="biaodan-q";
tr2.insertCell().innerHTML=' <input type="button" value="删除" onclick="javascript:deleteItem();" title="'+count+'">';
tr2.insertCell().innerHTML=' <input type="button" value="保存" onclick="javascript:getServerHtml();" title="'+count+'">'; tr2.insertCell().innerHTML=' <input name="textfield" type="text" size="20">'; tr2.insertCell().innerHTML=' <input name="textfield2" type="text" size="10">'; tr2.insertCell().innerHTML=' <select name="select3" class="kuang"><option>――</option><option selected>任务B</option></select>'; tr2.insertCell().innerHTML=" <input name='STARTDate"+count+"' type=text class=kuang id='STARTDate"+count+"' title='STARTDate"+count+"' value=2007-01-01 size=12> <a href='#' onClick='javascript:popUpCalendar(this, window.document.getElementById('STARTDate1'), 'yyyy-mm-dd');'><img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
tr2.insertCell().innerHTML=" <input name='ENDDate"+count+"' type=text class=kuang id='ENDDate"+count+"' title='ENDDate"+count+"' value=2007-01-01 size=12> <img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>"; tr2.insertCell().innerHTML=' <textarea name="textarea" cols="25" rows="2"></textarea>';
}
JS报错,说语法错误.本人愚钝,没检查出来,功能是这样的,想动态的为表格添加一行进行数据录入.谢谢大家帮忙.........我测试得出报错的代码是(功能为选择起始日期,调用日历控件(JS)...):
tr2.insertCell().innerHTML=" <input name='STARTDate"+count+"' type=text class=kuang id='STARTDate"+count+"' title='STARTDate"+count+"' value=2007-01-01 size=12> <a href='#' onClick='javascript:popUpCalendar(this, window.document.getElementById('STARTDate1'), 'yyyy-mm-dd');'><img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
tr2.insertCell().innerHTML=" <input name='ENDDate"+count+"' type=text class=kuang id='ENDDate"+count+"' title='ENDDate"+count+"' value=2007-01-01 size=12> <img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
var count = 1;function addItem(){
count = count + 1;
var e=window.event.srcElement;
var tr1=e.parentElement.parentElement;
var tr2=mainTable.insertRow();
tr2.className="biaodan-q";
tr2.insertCell().innerHTML=' <input type="button" value="删除" onclick="javascript:deleteItem();" title="'+count+'">';
tr2.insertCell().innerHTML=' <input type="button" value="保存" onclick="javascript:getServerHtml();" title="'+count+'">'; tr2.insertCell().innerHTML=' <input name="textfield" type="text" size="20">'; tr2.insertCell().innerHTML=' <input name="textfield2" type="text" size="10">'; tr2.insertCell().innerHTML=' <select name="select3" class="kuang"><option>――</option><option selected>任务B</option></select>'; tr2.insertCell().innerHTML=" <input name='STARTDate"+count+"' type=text class=kuang id='STARTDate"+count+"' title='STARTDate"+count+"' value=2007-01-01 size=12> <a href='#' onClick='javascript:popUpCalendar(this, window.document.getElementById('STARTDate1'), 'yyyy-mm-dd');'><img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
tr2.insertCell().innerHTML=" <input name='ENDDate"+count+"' type=text class=kuang id='ENDDate"+count+"' title='ENDDate"+count+"' value=2007-01-01 size=12> <img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>"; tr2.insertCell().innerHTML=' <textarea name="textarea" cols="25" rows="2"></textarea>';
}
JS报错,说语法错误.本人愚钝,没检查出来,功能是这样的,想动态的为表格添加一行进行数据录入.谢谢大家帮忙.........我测试得出报错的代码是(功能为选择起始日期,调用日历控件(JS)...):
tr2.insertCell().innerHTML=" <input name='STARTDate"+count+"' type=text class=kuang id='STARTDate"+count+"' title='STARTDate"+count+"' value=2007-01-01 size=12> <a href='#' onClick='javascript:popUpCalendar(this, window.document.getElementById('STARTDate1'), 'yyyy-mm-dd');'><img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
tr2.insertCell().innerHTML=" <input name='ENDDate"+count+"' type=text class=kuang id='ENDDate"+count+"' title='ENDDate"+count+"' value=2007-01-01 size=12> <img src='../images/Date.gif' width='20' height='19' border='0' align='absmiddle'></a>";
解决方案 »
- 请教一个extjs的问题!这问题很奇怪,希望大家帮我看看!
- 如何设置页面上所有的input type = text 的readonly属性为true。。在线等啊
- 关于微软的语音开发包SDK5.1网页版上传到自己的网站后不能正确使用的问题
- 谁有我的RP烂?请进!看史上最郁闷的JS问题!(不求解决了~!)
- 关于用JavaScript删除一个 Table 中的所有行的问题。(JS高手进)
- 如何使用JavaScript控制图片的亮度,对比度 等功能
- 哪位朋友能帮我解释一下这个定义是什么意思?字符数组么?
- 请教一个若若的问题
- 急!!!如何得到数组
- htttp://www.itfriend.cn 首页的动画效果如何实现的
- 在火狐浏览器中不能用设为首页后台添加到收藏夹?
- 正则表达式式:$的写法???
'javascript:popUpCalendar(this, window.document.getElementById( 'STARTDate1"+conut+" '), 'yyyy-mm-dd '); '>
写法有错误
document.getElementById("STARTDate1"+conut)
tr2.insertCell().innerHTML= " <input name= 'STARTDate "+count+ " ' type=text class=kuang id= 'STARTDate "+count+ " ' title= 'STARTDate "+count+ " ' value=2007-01-01 size=12> <a href= '# ' onClick= \"javascript:popUpCalendar(this, window.document.getElementById( 'STARTDate1 '), 'yyyy-mm-dd '); \"> <img src= '../images/Date.gif ' width= '20 ' height= '19 ' border= '0 ' align= 'absmiddle '> </a> ";里面引号用错了;\"javascript:popUpCalendar(this, window.document.getElementById( 'STARTDate1 '), 'yyyy-mm-dd '); \"
............解决了