自动添加行



var form = document.forms[0];		  
		var objTable = document.getElementById("specialFee");
		var objTableBody=objTable.children(0);
		var rowCount = objTable.rows.length;		 
		var newRow = document.createElement("TR");
		newRow.align = "center";		 
		newRow.style.background = "#E6FFF2"; 
		 
		var objCell1 = document.createElement("TD");
		objCell1.align="center";
		var objInput1_1 = document.createElement("<input  name='Vchbox' type='checkbox' value=''>");
		objInput1_1.id="Vchbox"+innum;
		objInput1_1.attachEvent("onclick",new Function("vcheck(" +innum+ ");"));
		objCell1.appendChild(objInput1_1);
		newRow.appendChild(objCell1);		
				
		var objCell2 = document.createElement("TD");	
		objCell2.align="center";
		var objInput2_1 = document.createElement("<input name='VSailNo'  style='text-align: center;'  type='text' class='input80' maxlength='6' size='6'>");		
		objInput2_1.id="VSailNo"+innum;
		objCell2.appendChild(objInput2_1);
		newRow.appendChild(objCell2);			
		 
		 
		var objCell10 = document.createElement("TD");		
		var objInput10_1 = document.createElement("<select name='VFerry'>");
		objInput10_1.id="VFerry"+innum;
		objInput10_1.style.width="120";
		<%		
		for(int i=0;i<ferryinfo_res.size();i++){
		 dynaBean = (DynaBean)ferryinfo_res.get(i);
		%>		
		var objOption10_<%=i%> = document.createElement("option");	
		objOption10_<%=i%>.text="<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("FerryInfo_cname")).trim())%>(至<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("City2_name")))%>)";
		objOption10_<%=i%>.value= "<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("FerryInfo_ferry")).trim())%>,<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("City1_name")).trim())%>,<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("City2_name")).trim())%>";
		objInput10_1.add(objOption10_<%=i%>);	
		 <%}%>
	    objInput10_1.attachEvent("onchange",new Function("f(" +innum+ ");"));
		objCell10.appendChild(objInput10_1);
		newRow.appendChild(objCell10);
				 
		var objCell3 = document.createElement("TD");
		objCell3.align="center";
		var objInput3_1 = document.createElement("<input  name='VDeparture'  readonly='readonly' style='text-align: center;'  type='text' class='input80' maxlength='20' size='10'>");
		objInput3_1.id="VDeparture"+innum;
		objInput3_1.text="<%=CmnUtFunc.HtmlEncode(String.valueOf(dynaBean.get("City1_name")).trim())%>";
		objCell3.appendChild(objInput3_1);
		newRow.appendChild(objCell3); 
		
		objTableBody.appendChild(newRow);


你可能感兴趣的:(F#)