Jump to content
Sign in to follow this  
tommytx

How to tick a radio box based on its existing value?

Recommended Posts

tommytx

Local $oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
    if $oInput.value = "posts" then $oInput.checked = "checked"
    consolewrite($oInput.value & @CR)
Next


;<input type="radio" name="content" value="all" checked="checked" /> All content</label></p>
;<input type="radio" name="content" value="posts" /> Posts</label></p>

What am i doing wrong..I want to inspect all the inputs on the page and there are many...and find the one that has a value equal to "posts" and check the radio box associated with that particular input.

On start as you can see the All Content is checked.. I want to switch to the one with value="posts"

Thanks for any assistance.

Tom

Share this post


Link to post
Share on other sites
dragan

I would use:

$oInput.checked = true

Share this post


Link to post
Share on other sites
tommytx

I tried true... let me go back and try true again... I think I tried "True"  "true" and true and True....

but just to be sure will run it again...

Yes it is encapulated in a form... will try that also....

It finds the value='post' just fine... but does not move the tick box...

Thanks... will let you know..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×