国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP之處理用Javascript動態(tài)添加的表單元素數(shù)據(jù)的代碼

2024-05-04 11:01:08
字體:
供稿:網(wǎng)友
上一篇文章講到了動態(tài)添加表單元素,這次我們來講講怎么樣來處理這些動態(tài)添加的表單元素傳過來的數(shù)據(jù)! 怎么樣動態(tài)添加表單元素,我這里就不細說了!不明白的看看上一篇文章//www.survivalescaperooms.com/html/200711/23/12856.htm下面是動態(tài)添加表單元素的頁面代碼!
復(fù)制代碼 代碼如下:
<html > 
<head> 
<title>動態(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";//這個是必須的,在處理頁中要用到! 
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>動態(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ù)對數(shù)據(jù)進行分割! 
Response.Write("這是未分割的數(shù)據(jù):") 
 Response.Write(data) 
 Response.Write("<br>") 
 Response.Write("<br>") 
 Response.Write("這是用Split函數(shù)分割后的數(shù)據(jù):") 
 Response.Write("<br>") 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 星子县| 赣州市| 金阳县| 友谊县| 湘乡市| 临桂县| 修水县| 玉田县| 祁连县| 赤水市| 唐海县| 乡宁县| 罗源县| 荃湾区| 玛沁县| 达孜县| 庄浪县| 崇文区| 孟村| 广州市| 轮台县| 平陆县| 扎囊县| 平潭县| 汉阴县| 武宁县| 枣庄市| 中宁县| 武安市| 南皮县| 盘山县| 长岭县| 和龙市| 古田县| 沁水县| 洛宁县| 岳池县| 海淀区| 正镶白旗| 崇阳县| 锡林浩特市|