范例
<HTML>
<HEAD></HEAD>
<BODY>
<script language="VBScript">function IntoIT()
Set MyIT = Window.document set oObjects = MyIT.all.item("R1")
for each oObj in oObjects
if oObj.checked then
astr=astr+oObj.Value+"Is selected"+chr(13)+chr(10)
else
astr=astr+oObj.Value+"Is not selected"+chr(13)+chr(10)
end if
next
MyIT.write astr
end function
</SCRIPT><form method="POST" action="--WEBBOT-SELF--">
<p><input type="radio" value="V1" checked name="R1"></p>
<p><input type="radio" name="R1" value="V2"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
<p><b><a href="VBScript:IntoIT()" ><br>
加入收藏夹</a></b></span></p>
</form>
</BODY>
</HTML>
<HTML>
<HEAD></HEAD>
<BODY>
<script language="VBScript">function IntoIT()
Set MyIT = Window.document set oObjects = MyIT.all.item("R1")
for each oObj in oObjects
if oObj.checked then
astr=astr+oObj.Value+"Is selected"+chr(13)+chr(10)
else
astr=astr+oObj.Value+"Is not selected"+chr(13)+chr(10)
end if
next
MyIT.write astr
end function
</SCRIPT><form method="POST" action="--WEBBOT-SELF--">
<p><input type="radio" value="V1" checked name="R1"></p>
<p><input type="radio" name="R1" value="V2"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
<p><b><a href="VBScript:IntoIT()" ><br>
加入收藏夹</a></b></span></p>
</form>
</BODY>
</HTML>
解决方案 »
- 我就这么多分数,基本上全部的放上了,请大家回答打印以及数据库空数据筛选的问题。
- 请各位大哥,帮一下小弟吧!如何实现数据批量录入呀!我把每个字段对应一个文本框,但一次只能存入数据库中一条记录
- 高手请进:如下代码:cnA.Execute "delete from A,B,C where (A.班级='2BAN') and (A.编号=B.编号) and (A.编号=C.编号)"
- 向数据库中SQL中添加记录.addnew怎么不成功呀,程序运行过程中也没有报错,就是数据库中没有添加的记录。
- toolbar菜单问题?
- 为什么vb6的数据窗体向导识别不了access2000的数据库文件?
- datagrid中鼠标单击某一单元格,怎样获得该单元格的内容
- 自己写了个多线程网络蜘蛛。。
- 如何用最简单的代码实现MouseExit功能?
- vb图象框控件如何和Access数据库的OLE对象联接(位图)
- 请问在VB里怎样得到同时按下俩个键,比如 w 和 a .
- 如何快速在检索结果中定位某一记录?
怎么建一个循环把网页中的form里输入的值都读出来,中间用"+"隔开。form中有text,select和radio。当然你的函数中能包括checkbox等就最好了。
<HTML>
<HEAD></HEAD>
<BODY>
<script language="VBScript">function IntoIT()
On error resume next
Set MyIT = Window.document
for each oEles in MyIT.all
if typename(oEles)="HTMLFormElement" then
for each oInput in oEles.all
Select Case oInput.Type
case "radio"
if oInput.checked then
astr=astr+oInput.Value+"Is selected <br>"
else
astr=astr+oInput.Value+"Is not selected <br>"
end if
case "text"
astr="<p> text is "+astr+oInput.Value+"</p>"
case else
end select
next
end if
next
MyIT.write astr
end function
</SCRIPT><form method="POST" action="--WEBBOT-SELF--">
<p><input type="radio" value="V1" checked name="R1"></p>
<p><input type="radio" name="R1" value="V2"></p>
<p><input type="text" name="T1" size="20"></p>
<p><select size="1" name="D1">
<option>A1</option>
<option>A2</option>
<option>A3</option>
</select></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
<p><b><a href="VBScript:IntoIT()" ><br>
加入收藏夹</a></b></span></p>
</form>
</BODY>
</HTML>
基本上就是通过遍历访问页面中的元素来实现的