Hi,
So I know it's a rather simple issue but all the answers I've looked up online did not help, so..
How can I verify that the object in question (a checkbox within a web page) is checked or not?
see snapshot included. Nothing helps :\
please note-once created the function, the repository object looks like this in my function declaration:
RepoItemInfo divtagInfo
thanks...
checkbox validation
checkbox validation
You do not have the required permissions to view the files attached to this post.
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: checkbox validation
Thank you for posting the SnapShot, this would have gone a whole other direction without it.
The problem you're facing is that it is not a checkbox, so you can't validate a check state. If you jump up to the DIV parent of the Span, you'll notice it's class is "r-checkbox selected". If you do the same for the other 3 similar checkboxes, you'll see that the checked ones are r-checkbox selected and the unchecked ones are r-checkbox.
So if you're trying to validate this as "checked" versus "unchecked", I'd find the DIV tag by the innertext property and validate that its class attribute is r-checkbox selected.
The problem you're facing is that it is not a checkbox, so you can't validate a check state. If you jump up to the DIV parent of the Span, you'll notice it's class is "r-checkbox selected". If you do the same for the other 3 similar checkboxes, you'll see that the checked ones are r-checkbox selected and the unchecked ones are r-checkbox.
So if you're trying to validate this as "checked" versus "unchecked", I'd find the DIV tag by the innertext property and validate that its class attribute is r-checkbox selected.
Doug Vaughan
Re: checkbox validation
that solved my problem - thank you!