for(var i=0;i<document.all.length;i++)
{
//document.all[i]控件
}
{
//document.all[i]控件
}
解决方案 »
- 帮忙写个正则表达式 关于替换的
- $("#ID",this).length==0能不能判断元素是否存在
- 求一个网页自动投票脚本
- 问一个调用javascript的问题 在线等急死我了
- 为什么在选项卡中百度地图 加了display:none; 会不显示背景
- 如何把数据加在到指定列的末尾?
- 我想把下面的代码放到 document.write(''); 里去,请问该怎么写才对呢?
- 如何使弹出窗口的大小为1象素,就是让用户不发现?急,在线等
- 请问,怎么打印一个框架中的某一个框架页? !!
- 怎么判断strTmp中是否包含一个字符,如是否包含%等?
- 弹出窗体无边框的问题
- 请问meizz:"梅花雨日历控件2.02版"可不可以在IE以外的浏览器的?
<form action="test.asp">
<input value="abc" name="a1">
<input value="abcdefg" name="a2">
<input value="abcdefg">
<input type=checkbox value="zzz" name="a3" checked>
<input type=checkbox value="..." name="b1">
<input type=radio value="r1" name="c1" checked>
<input type=radio value="r2" name="c1">
<input type=password value="123" name="b2">
<input type=password value="56" name="b3">
<textarea name="b4">hello world</textarea><br>
<select name="b5">
<option value="ff">ff</option>
<option value="gg">gg</option>
</select><br><br>
<input type=button onclick="javascript:f_submit()" value="确定">
</form>
<script>
function f_submit(){
var e=document.forms[0].elements
var arr=new Array()
for(var i=0;i<e.length;i++){
if (!e[i].name) continue;
if ((e[i].type=="checkbox") || (e[i].type=="radio")){
if (e[i].checked) arr.push(e[i].name+"="+e[i].value)
}else{
arr.push(e[i].name+"="+e[i].value)
}
}
var url=document.forms[0].action+"?"+arr.join("&")
alert(url)
// location.href=url
}
</script>