日期:2014-05-16  浏览次数:20474 次

js动态增加表单以及服务器如何接收参数

js动态增加表单页面:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#main {
height: 650px;
width: 800px;
margin-top: 5px;
margin-right: auto;
margin-left: auto;
}
#main strong {
letter-spacing: 2px;
font-size: 18px;
}
#main strong a {
text-decoration: none;
}
#main #form1 table tr td {
line-height: 25px;
}
#main #form1 table tr th {
height: 25px;
}
#main #form1 table tr td #button {
width: 50px;
}
#main #form1 table tr td #button2 {
width: 50px;
}
.td{
background-color: #FFE;
height: 30px;
}
.tds{
background-color: #CCC;
height: 30px;
}
#main #form1 table tr .td #textfield2 {
width: 125px;
}
#main #form1 table tr .td #textfield3 {
width: 125px;
}
#main #form1 table tr .td #textfield4 {
width: 125px;
}
#main #form1 table tr .td #textfield5 {
width: 125px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
var i=0
function Add1()
{
 var temp=document.getElementById("add")
 temp.insertRow(temp.rows.length);
 temp.rows.item(temp.rows.length -1).insertCell(0);
 var xx=temp.rows.length -1 ;//-1
 var sHTML
 sHTML='<TABLE border=\"1\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"width=\"100%\">' +
       '<TR>' +
       '<TD align=\"left\" width="25%"><SELECT NAME=\"\">'+
       '<option value=\"0\">&nbsp;-------------------&nbsp;</option>'+
  '<option value=\"1\">&nbsp;海马高度&nbsp;</option>' +
       '<option value=\"2\">&nbsp;脉络膜裂宽度&nbsp;</option>' +
   '<option value=\"3\">&nbsp;内嗅皮层厚度&nbsp;</option>' +
       '<option value=\"4\">&nbsp;颞叶干宽度&nbsp;</option>' +
   '<option value=\"5\">&nbsp;侧裂池宽度&nbsp;</option>' +
       '<option value=\"6\">&nbsp;海马total NAA/CR&nbsp;</option>' +
   '<option value=\"7\">&nbsp;海马total MI/CR&nbsp;</option>' +
       '<option value=\"8\">&nbsp;头NAA/CR&nbsp;</option>' +
   '<option value=\&quo