人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

對于如何動態(tài)地在同一頁面完成2個互傳(s1  s2)

對于如何動態(tài)地在同一頁面完成2個互傳(s1 s2)

更新時間:2020-12-07 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

hello! 先祝大家中秋節(jié)快樂!

我們常常會碰到這樣一個問題: 如何將在同一頁面上的一個<select>或<listbox>的值傳到另一個<select>或<listbox>中 ?這是一個很煩人的問題?墒怯袝r候你偏偏會遇到。 那什么辦呢?

下面是我“煙酒”了一個上午, 現(xiàn)貼上來讓大家共享。 用的方法是很笨也挺麻煩。不過總是有點成就感的。呵呵!大家看看, 指點指點.....

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<script language="vbscript">

</script>
<body bgcolor="#ffffff">
<form name="form1" action="test01.asp" target="_self">
<p><TEXTAREA id=text01 name=text01></TEXTAREA></p>
<table>
<tr>
<td>
<select name="select1" language="javascript" size=5>
<option value=11111>11111</option>
<option value=22222>22222</option>
<option value=33333>33333</option>
</select>
</td>
<td>
<label onClick=do_select()><font color=#ff00dc><u>->> </u></font> </label><br><br>
<label onClick=do_select2()><font color=#ff00dc><u><<- </u></font> </label>
</td>
<%
str="function do_select() {" & vbCrlf & _
"if (document.form1.select1.options.length > 0) {"&vbCrlf&_
"var j=0;"&vbCrlf&_
"for(var i=0;i<document.form1.select1.options.length;i++) {"&vbCrlf & _
"if(document.form1.select1.options(i).selected) {"&vbCrlf& _
"j=j+1; break" & vbCrlf & "}"&vbCrlf & "}"&vbCrlf& _
"if (j > 0) {"&vbCrlf&_ "document.form1.sel2.options[document.form1.sel2.options.length] = new Option(" & _
"document.form1.select1.options[document.form1.select1.selectedIndex].value," & _
"document.form1.select1.options[document.form1.select1.selectedIndex].value);"& vbCrlf
Response.Write "<td><SELECT id=sel2 name=sel2 size=5>"
Response.Write "</select></td>"
str=str&vbCrlf&"document.form1.select1.options[document.form1.select1.selectedIndex]=null;"&vbCrlf & _
"if (document.form1.select1.options.length > 1) {"&vbCrlf '&_
str=str&vbCrlf & "}" & vbCrlf & "}" & vbCrlf& "}" & vbCrlf& "}" & vbCrlf
Response.Write "<SCR"& "IPT LANGUAGE=""JavaScript"">" & vbCrlf
Response.Write str & vbCrlf & "</SCR"&"IPT>"& vbCrlf

%>

<%
str=""
str="function do_select2() {" & vbCrlf & _
"if (document.form1.sel2.options.length > 0) {"&vbCrlf&_
"var j=0;"&vbCrlf&_
"for(var i=0;i<document.form1.sel2.options.length;i++) {"&vbCrlf & _
"if(document.form1.sel2.options(i).selected) {"&vbCrlf& _
"j=j+1; break" & vbCrlf & "}"&vbCrlf & "}"&vbCrlf& _
"if (j > 0) {"&vbCrlf&_
"document.form1.select1.options[document.form1.select1.options.length] = new Option(" & _
"document.form1.sel2.options[document.form1.sel2.selectedIndex].value," & _
"document.form1.sel2.options[document.form1.sel2.selectedIndex].value);"& vbCrlf
str=str&"document.form1.sel2.options[document.form1.sel2.selectedIndex] =null;" & vbCrlf &"}"& vbCrlf &"}"& vbCrlf &"}"
Response.Write "<SCR"& "IPT LANGUAGE=""JavaScript"">" & vbCrlf
Response.Write str & vbCrlf & "</SCR"&"IPT>"& vbCrlf
%>

</tr>

</form>
</body>
</HTML>

很笨吧, 哈哈!
若那位大蝦有更好的方法, 可別忘了給我寄上一份哦。
E_Mail: fz_chenjl@163.net

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 潜江市| 盐池县| 浑源县| 新龙县| 唐山市| 江达县| 富裕县| 南宁市| 清徐县| 双城市| 阿坝县| 同仁县| 宁明县| 彝良县| 安化县| 郸城县| 万宁市| 龙门县| 沅陵县| 龙泉市| 甘南县| 内江市| 巴东县| 菏泽市| 宁远县| 邹城市| 吉木乃县| 鄂托克前旗| 大关县| 鸡东县| 故城县| 花垣县| 六枝特区| 平山县| 游戏| 满城县| 文山县| 莱西市| 长春市| 文水县| 米林县|