需求单位 需求部门 需求联系人 期望完成日期 需求名称 需求概述 <script type="text/javascript"><input type="button" οnclick="addRow();" value="add"/> </p> <input type="button" οnclick="delRow();" value="del"/> </p> <table width="643" height="149" border="1" align="center"> <tbody id="req_add"> <tr> <td width="20" rowspan="4" scope="row"> <input type="radio" name="operation" value="operation" /> </td> <td width="80">需求单位</td> <td width="222"> <input id="org" name="org" value=""/></td> <td width="110">需求部门</td> <td width="177"> <input id="dept" name="dept" value=""/></td> </tr> <tr> <td>需求联系人</td> <td> <input id="user" name="user" value=""/></td> <td>期望完成日期</td> <td> <input id="time" name="time" value=""/></td> </tr> <tr> <td>需求名称</td> <td colspan="3"> <input id="Text1" name="org" value=""/></td> </tr> <tr> <td>需求概述</td> <td colspan="3"> <input id="Text2" name="org" value=""/></td> </tr> </tbody> </table> <mce:script type="text/javascript"><!-- function addRow(){ var tb=document.getElementById("req_add"); for(var i=0;i<4;i++){ var obj=tb.insertRow(); for(var j=0;j<tb.rows[i].cells.length;j++){ obj.insertCell(); obj.cells[j].innerHTML=tb.rows[i].cells[j].innerHTML; obj.cells[j].setAttribute("width",tb.rows[i].cells[j].getAttribute("width")); if(tb.rows[i].cells[j].getAttribute("rowSpan")>1)obj.cells[j].setAttribute("rowSpan",tb.rows[i].cells[j].getAttribute("rowSpan")); if(tb.rows[i].cells[j].getAttribute("colSpan")>1)obj.cells[j].setAttribute("colSpan",tb.rows[i].cells[j].getAttribute("colSpan")); if(tb.rows[i].cells[j].getAttribute("scope")!="")obj.cells[j].setAttribute("scope",tb.rows[i].cells[j].getAttribute("scope")); } } } function delRow(){ var tb=document.getElementById("req_add"); var rdo=document.getElementsByName("operation"); var index=-1; for(var i=0;i<rdo.length;i++) if(rdo[i].checked) index=i; if(index!=-1){ alert("Selected: "+(index+1)); index=rdo[index].parentNode.parentNode.rowIndex; for(var i=0;i<4;i++){ tb.removeChild(tb.childNodes[index]); } } } // --></mce:script> </script>