Results 1 to 9 of 9

Thread: Setting fields in WebBrowser

  1. #1
    rsitogp
    Guest
    How do I set a radio value ?
    I.e. WebBrowser1.Document.Forms(0).radioname.Value = "Option1"?

    The HTML is:
    <INPUT TYPE="RADIO" NAME="O_T" VALUE="O" >O&nbsp;
    <INPUT TYPE="RADIO" NAME="O_O" VALUE="T" >T

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    <INPUT TYPE="RADIO" NAME="O_T" VALUE="O" checked>

    You can also do this in VBScript. This requires a browser which supports DHTML. To do this you must have the input tag inside div tags.

    <div id=test>
    <INPUT TYPE="RADIO" NAME="O_T" VALUE="0">
    </div>

    To turn it on use the following code:

    Code:
    test.InnerHtml = "<INPUT TYPE=""RADIO"" NAME=""O_T"" VALUE=""0"" CHECKED>"
    To turn it off use:

    Code:
    test.InnerHtml = "<INPUT TYPE=""RADIO"" NAME=""O_T"" VALUE=""0"">"
    Hope that helped.

  3. #3
    rsitogp
    Guest
    Thanks but I would like to do it in VB using the webbrowser control what I do for text is:
    WebBrowser1.Document.Forms(0).textboxname.Value = "Whatever"

    can you tell me how to do that with radio/checkboxes?

  4. #4
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Then you can use:

    Code:
    WebBrowser1.document.forms("test").R1.checked = false

  5. #5
    rsitogp
    Guest
    Thanks, that works for a checkbox, what about a radio?

  6. #6
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    It is the same for radio.

  7. #7
    rsitogp
    Guest
    sorry, but it doesn't work, and I can't use it for a radio like:
    <INPUT TYPE="RADIO" NAME="O_T" VALUE="O" >O
    <INPUT TYPE="RADIO" NAME="O_T" VALUE="T" >T

    webbrowser1.forms(0).O_T.????

  8. #8
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Code:
    WebBrowser1.document.forms("test").O_T.checked = false

  9. #9
    rsitogp
    Guest
    Thanks, but what I want to know is how to choose one of them (O or T).

    And one more question, I've suceeded in loging into yahoo mail and getting into the inbox throught webbrowser in vb but I would like to know how I can open a cerin message titled "Yahoo!" (welcome to yahoo message), can I do something like:
    webbrowser1.document.forms(0).("Yahoo!").click ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width