欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP之處理用Javascript動(dòng)態(tài)添加的表單元素?cái)?shù)據(jù)的代碼

 更新時(shí)間:2007年11月24日 12:27:52   作者:  
上一篇文章講到了動(dòng)態(tài)添加表單元素,這次我們來講講怎么樣來處理這些動(dòng)態(tài)添加的表單元素傳過來的數(shù)據(jù)! 怎么樣動(dòng)態(tài)添加表單元素,我這里就不細(xì)說了!不明白的看看上一篇文章http://www.dbjr.com.cn/html/200711/23/12856.htm下面是動(dòng)態(tài)添加表單元素的頁面代碼!
復(fù)制代碼 代碼如下:

<html > 
<head> 
<title>動(dòng)態(tài)添加表單元素BlueShine</title> 
</head> 
<script language="javascript"> 
function AddElement(mytype){ 
var mytype,TemO=document.getElementById("add"); 
var newInput = document.createElement("input");  
newInput.type=mytype;  
newInput.name="input1";//這個(gè)是必須的,在處理頁中要用到! 
TemO.appendChild(newInput); 
var newline= document.createElement("br"); 
TemO.appendChild(newline); 

</script> 
<body> 
 <form action="getdata.asp" method="post" name="frm"> 
 <p style=" background:#FFEC8B;border:solid 1px #1E90FF;font-size:13px;line-height:200%;width:100px;text-align:center"><a style="color:#218868;" href="javascript:void(0)" onClick="AddElement('text')">添加文本框</a></p> 
 <p id="add"></p> 
   <label> 
   <input type="submit" name="Submit" value="提交"> 
   </label> 
   <label> 
   <input type="reset" name="Submit2" value="重置"> 
   </label> 
</form> 
</body> 
</html> 

下面是數(shù)據(jù)處理頁面代碼:  
復(fù)制代碼 代碼如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 
<!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=gb2312" /> 
<title>動(dòng)態(tài)添加表單元素</title> 
</head> 
<body> 
<div style="font-size:13px"><% 
dim data,arr,n 
data=Trim(Request.Form("input1"))'這就是在代碼中定義的name屬性 
arr=split(data,",")'用Split函數(shù)對(duì)數(shù)據(jù)進(jìn)行分割! 
Response.Write("這是未分割的數(shù)據(jù):") 
 Response.Write(data) 
 Response.Write("<br>") 
 Response.Write("<br>") 
 Response.Write("這是用Split函數(shù)分割后的數(shù)據(jù):") 
 Response.Write("<br>") 
 for n= 0 to ubound(arr) 
 Response.Write(arr(n)) 
 Response.Write("<br>") 
 Next 
  %></div> 
</body> 
</html> 

相關(guān)文章

最新評(píng)論