找回密码
 加入
搜索
查看: 2235|回复: 1

[IE类操作] ie中如何设置单选框的值

[复制链接]
发表于 2010-4-23 08:31:51 | 显示全部楼层 |阅读模式
ie中如何设置单选框的值   
_IEFormElementSetValue是它吗?

我试了怎么不行啊
发表于 2010-5-1 16:55:33 | 显示全部楼层
; *******************************************************
; Example 1 - Open a browser with the form example, get reference to form, select
;               each radio button byValue, then deselect the last item leaving none selected.
;               Note: You will likely need to scroll down on the page to see the changes
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
For $i = 1 To 5
    _IEFormElementRadioSelect ($oForm, "vehicleAirplane", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleTrain", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleBoat", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleCar", "radioExample", 1, "byValue")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, "vehicleCar", "radioExample", 0, "byValue")
    Sleep(1000)
Next

; *******************************************************
; Example 2 - Open a browser with the form example, get reference to form, select
;               each radio button byIndex, then deselect the last item leaving none selected.
;               Note: You will likely need to scroll down on the page to see the changes
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
For $i = 1 To 5
    _IEFormElementRadioSelect ($oForm, 3, "radioExample", 1, "byIndex")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, 2, "radioExample", 1, "byIndex")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, 1, "radioExample", 1, "byIndex")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, 0, "radioExample", 1, "byIndex")
    Sleep(1000)
    _IEFormElementRadioSelect ($oForm, 0, "radioExample", 0, "byIndex")
    Sleep(1000)
Next
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-28 03:56 , Processed in 0.077049 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表