example code
Code: Select all
<form>
<p><input type="radio" name="R1" value="V1" ></p>
<p><input type="radio" name="R1" value="V2"></p>
</form>
iMacros 8.9.7
Windows 8.1
Code: Select all
<form>
<p><input type="radio" name="R1" value="V1" ></p>
<p><input type="radio" name="R1" value="V2"></p>
</form>
Post a Site with some RB for me to do any Testing...techimac wrote:how to check if any radio button from a group is selected or not?
example codeFirefox 47Code: Select all
<form> <p><input type="radio" name="R1" value="V1" ></p> <p><input type="radio" name="R1" value="V2"></p> </form>
iMacros 8.9.7
Windows 8.1
Yeah, I don't know, you didn't post a "concrete" URL, so I had a look at the Page on the Forum when posting a Reply or a Quote, with the 'Post icon' RB's, the first one (= "None") is automatically selected when the Page is loaded for the first time, and it has indeed some "checked="checked"" Attribute, but even after changing the RB Selection to another Icon, and the Selection remains after a Refresh of the Page, but it's always (and only) the 'None' Icon that still has this 'checked' Attribute while it is actually a different Icon which is selected...techimac wrote:I got the solution for checking particular radio button
need a way to find if any radio button is selected or not in a group
I tried ATTR=CHECKED:CHECKED EXTRACT=TXT
but it didn't worked.
OK...techimac wrote:ATTR=CHECKED:CHECKED EXTRACT=TXT
element was not available
once I have the solution or found proper HTML code to find solution, I will share
Yeah, sure..., that can always be useful for other Users and that might give me some "Ideas", ah-ah...!techimac wrote:I can give you code for checking single radio button state
techimac wrote:TAG POS=1 TYPE=............ EXTRACT=CHECKED
"YES" if checked and "NO" if not checked
Oh..., yes of course, "EXTRACT=CHECKED"...!!
I have written javascript code for thatchivracq wrote:techimac wrote:TAG POS=1 TYPE=............ EXTRACT=CHECKED
Well, then, if you don't know in advance which RB is checked, you simply need to extract them all and using 'EVAL()' + 'if/else' or 'CASE' to find out which one is selected, that's not very complicated...
Or you store all YES/NO Values in a String or Array and using 'split()' x2, first on "YES" and then on "NO", then the Length of the 2nd Array gives you the Position of which RB is selected...