Consulting

Results 1 to 2 of 2

Thread: VBA Internet Explorer Radio Button Help Needed

  1. #1

    VBA Internet Explorer Radio Button Help Needed

    I have seen a couple of posts related to this and either I am doing something wrong (which is probably the case) or I am not understanding how this works.

    Essentially I have some HTML Source for several radio buttons and need to select option 2.

    Here is the relevant HTML source:
    This is the form
    <formname="myform" method="post" action="default_new.asp" onSubmit="return(false);">

    <tdclass="medium" align="right" nowrapvalign="top"><b>Select Action: &nbsp;</b></td>

    <inputtype="radio" name="TypeID" value="1" onclick="document.myform.Continue.value='';SubmitForm()">New Setup<br>
    <Inputtype="radio" name="TypeID" value="2" onclick="document.myform.Continue.value='';SubmitForm()">Modify Setup<br>
    <inputtype="radio" name="TypeID" value="3" onclick="document.myform.Continue.value='';SubmitForm()">Deactivate Setup<br>
    <inputtype="radio" name="TypeID" value="4" onclick="document.myform.Continue.value='';SubmitForm()">Order Submission<br>


    Here is an example of how I tried to get option 2 selected:

    ie.Document.forms("myform").getElementById("TypeID")(2).Checked = True

    I am probably missing missing something, but any assistance anyone could provide would be greatly appreciated.

    Thanks!

  2. #2
    You haven't said how your code doesn't work. Does it compile? Does it produce a run-time error? Does it select the wrong option, etc.?

    Maybe:
    [vba]ie.Document.forms("myform").elements("TypeID")(1).Checked = True[/vba]

Posting Permissions

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