Forum Discussion

ANW's avatar
ANW
Contributor
15 years ago

Working with Radio buttons on a webpage

I am having some periodical issues with activating some of the radio buttons on the web pages we test.



Now I have checked the help for working with radio buttons. But that seem to just describe how to work with standard windows radio buttons. And SetFocus method doesn't exist for my radio buttons on the web page.



As Click requires an object to be VisibleOnScreen to work, I can't use that (Sometimes objects have to be found by scrolling down). So I started using Keys(' ') to simulate using the SPACE key inside the radio button. This works ... about 98% of the time. But sometimes it just fails to set the radio button, even though the code executes just fine.



So I need another sure-proof way of setting the radio button.



I tried looking for the Checked property, and then set that directly. This seems to work every time. But the selection of the radio button is supposed to load a new form on screen, and nothing happens if I just set the Checked property.



I have not been able to find a method that does what I want.



I want the radio button to be selected, so the new form loads on screen.



Anyone have any sugesstions on how to do this??



Only alternative I can think of, is to make a procedure that uses the Keys method, and then checks if Checked is set to True. If not it will repeat the Keys method, until it is set correctly. Seems like a complicated way of ensuring that a radio button is set.

2 Replies

  • Hi,



    As Click requires an object to be VisibleOnScreen to work, I can't use that (Sometimes objects have to be found by scrolling down).


    You can try focusing a radio button by calling its focus method and then clicking the radio button.