[求助] ja不运行的怎么一回事
程序如下: 程序代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www."> <html xmlns="http://www."> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title><script language="JavaScript"> function addOrderRow(tab,rowNum,colNum,obj,addType) { var detailbody=document.getElementById(tab); var row = document.createElement("tr"); var newrow=obj.parentNode.parentNode.innerHTML; if(addType=='add'){ var row = detailbody.insertRow(); for(var i=0;i<obj.parentNode.parentNode.childNodes.length;i++){ var cell=row.insertCell(); cell.innerHTML=obj.parentNode.parentNode.childNodes[i].innerHTML; //如果表单中有值就清空 for(var k=0;k<cell.childNodes.length;k++) { if (cell.childNodes[k].type == 'text') { cell.childNodes[k].value = ''; } if (cell.childNodes[k].type == 'textarea') { cell.childNodes[k].value = ''; } if (cell.childNodes[k].type == 'checkbox') { cell.childNodes[k].checked = false; } if (cell.childNodes[k].type == 'radio') { cell.childNodes[k].checked = false; } if (cell.childNodes[k].type == 'select-multiple') { cell.childNodes[k].selectedIndex = -1; } if (cell.childNodes[k].type == 'select-one') { cell.childNodes[k].selectedIndex = -1; } } } obj.parentNode.parentNode.childNodes[0].innerHTML+='<input type=hidden id=text'+(detailbody.childNodes.length+1)+'>'; }else if(addType=='copy'){ //copy var row = detailbody.insertRow(); for(var i=0;i<obj.parentNode.parentNode.childNodes.length;i++){ var cell=row.insertCell(); cell.innerHTML=obj.parentNode.parentNode.childNodes[i].innerHTML; } obj.parentNode.parentNode.childNodes[0].innerHTML+='<input type=hidden id=text'+(detailbody.childNodes.length+1)+'>'; }else{ //delete if(confirm("确定删除此行数据吗?")){ obj.parentNode.parentNode.parentNode.removeChild(obj.parentNode.parentNode); }else{ return false; } } //只显示最后一个add按钮 var leg = detailbody.childNodes.length; if(leg>1){ for(var j=0;j<leg-2;j++){ document.getElementsByName("btnAdd")[j].style.visibility="hidden"; } document.getElementsByName("btnAdd")[leg-2].style.visibility="visible"; } //显示除第一个外所有delete按钮 if(leg>1){ for(var j=1;j<leg-1;j++){ document.getElementsByName("btnDelete")[j].style.visibility="visible"; } } } function show() { document.all.sum.value=parseInt(document.all.price.value)*parseInt(document.all.quantity.value); } </script></head> <body> <form id="form1" name="form1" method="post" action="untitled4.asp"> <div id="outlineChildaaa" style="cursor:auto" > <table width="700" border="1" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem"> <tbody id="detailItemBody"> <tr> <td width="38%" nowrap="" bgcolor="#F3EFCD" class="STYLE7 td1"><strong>名称</strong></td> <td width="19%" nowrap="" bgcolor="#F3EFCD" class="STYLE7 td1"><strong>单价</strong></td> <td width="10%" nowrap="" bgcolor="#F3EFCD" class="STYLE7 td1"><strong>数量</strong></td> <td width="10%" nowrap="" bgcolor="#F3EFCD" class="td1 STYLE7"><strong>价格</strong></td> <td width="23%" bgcolor="#F3EFCD" class="td1 STYLE7"><strong>操作 </strong></td> </tr> <tr id="tr1"> <td width="38%" id="td1" > <input type="hidden" name="SampleOrderContentID"/> <input type="text" size="30" name="name" id="ItemNo"/></td> <td width="19%" nowrap=""><input type="text" size="10" name="price" id="ItemNo1" onpropertychange"show1()" /></td> <td width="10%" nowrap=""><input type="text" size="6" name="quantity" id="Nickname1" onpropertychange"show1()"/></td> <td width="10%" nowrap=""><input type="text" size="6" name="sum" id="cleats1" onpropertychange"show1()" /></td> <td width="23%" nowrap=""> <input type="button" onclick="addOrderRow('detailItemBody',2,11,this,'add')" value="增加" id="btnAdd1" name="btnAdd"/> <input type="button" onclick="addOrderRow('detailItemBody',2,11,this,'copy')" value="复制" id="btnCopy" name="btnCopy"/> <input type="button" onclick="addOrderRow('detailItemBody',2,11,this,'delete')" value="删除" id="btnDelete" name="btnDelete" style="visibility:hidden "/></td> </tr> </tbody> </table> <table width="700" border="0"> <tr> <td><div align="center"> <label> <input type="submit" name="Submit" value="提交" /> </label> </div></td> </tr> </table> </div> </form> </body> </html>哪里出错了呢