+ Reply to Thread
Results 1 to 9 of 9

Radio buttons in IE

Hybrid View

Manni Radio buttons in IE 07-31-2008, 07:07 PM
Manni Ok so i think i maybe getting... 08-01-2008, 05:47 PM
Manni Still working on getting this... 08-05-2008, 07:20 PM
Tom Schreiner Hi Manni. Please post the... 08-06-2008, 05:53 AM
Manni I can give you some of the... 08-06-2008, 09:54 PM
Tom Schreiner Dim RadioButton As Object... 08-06-2008, 10:05 PM
Manni Tom Schreiner I want to thank... 08-07-2008, 09:24 PM
Tom Schreiner Yeah. I will need to see a... 08-08-2008, 03:06 PM
Manni Final update, I finaly got... 08-08-2008, 03:10 PM
  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8
    I can give you some of the html code you are looking for unfortuanatly due to the nature of the website we cannot give everything but the code you are looking for is like this.

    &nbsp;&nbsp;<input type="radio" class="check" name="voice_mark_|1218069880|014|21" value="L|N|1218069880001421|122">&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="check" name="voice_mark_|1218069880|014|21" value="S|N|1218069880001421|122">&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="check" name="voice_mark_|1218069880|014|21" value="D|N|1218069880001421|122">&nbsp;&nbsp;&nbsp;</td><td></td></tr>
    this is one set of linked radio buttons bt there could be more sets they will look exactly like this but there names and values will be slightly different. The Value of the one I will need will always start with L|N| but that is all. this is what has been making it so tough i will work with the code you gave me and see if i can get that to work or with this code if you could come up with something let me know. If you need more code i could make a mock of what we have but it would take quite some time so i hope this will do.

  2. #2
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
        Dim RadioButton As Object 'HTMLInputElement
    
        For Each RadioButton In IE.Document.forms(0).getElementsByTagName("INPUT")
            If RadioButton.Value Like "S|L|*" Then
                RadioButton.Checked = True
            End If
        Next

  3. #3
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8
    Tom Schreiner I want to thank you for your help. Here is an update on what is happening now So i tried using the code you listed (both of em) and found that this code did nothing no error nothing. the site loaded then it said it was done but nothing had changed and nothing was checked. it occured to me that it might be because of this line:
    For Each RadioButton In IE.Document.forms(0).getElementsByTagName("INPUT")
    Was i supposed to change the name input? I tried changing this and it still didnt seem to do anything at all. I am working on a mockup for the site that dosnt have employee info on it so that you can use it to figure out the problem. I do applogize that i have not been able to figure this out as i do know excel and vba but this new element of controling internet explorer is new to me.
    Last edited by Manni; 08-07-2008 at 09:33 PM.

  4. #4
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Yeah. I will need to see a true representation of the source. Some page contain code to validate "how" a control's property is changes. In other words, you may need to fire an event and/or set focus to the controlto change its value acceptably. I cannot know what your particular page is requiring until I see the entire source...

  5. #5
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8
    Final update, I finaly got it. the second code you posted that was alot like mine did it i was wondering why it didn't do anything then i realized that there are multiple forms on the page and had to switch the form name also me excel was getting an error with your like stament so i used my old one that works fine so below is my final code with some info:
        Dim RadioButton As Object 'HTMLInputElement
    
        For Each RadioButton In IE.Document.forms(1).getElementsByTagName("INPUT")
            If RadioButton.Value Like "S|L|" & "*" Then
                RadioButton.Checked = True
                Else
            End If
        Next
    Ok so above the Forms(1) means the second form as the first form is 0 for thoise reading this in the future how i found my forms was to use find and see how many "<form" i could find the second one was the one i needed.

    Next input seems to work for all of the inputs of the form so will allow me to do other things. This code works quickly too. thank you Tom Schreiner for your help i got working without a hitch.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1