+ Reply to Thread
Results 1 to 9 of 9

Radio buttons in IE

  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8

    Radio buttons in IE

    Ok so i have been working on this file for quite some time and have been programming in Excel for work for quite some time but now i am stumped.

    I need to log into a website then go to a specific page and copy info from the page into excel. I wrote this code in about 5 minutes not a problem. Now that i have done that I have to get excel to click a radio button and hit the submit button. The problem is the only code i can get to work for this is very specific and you have to know the name and the value of the radio button in Internet explorer. This is a problem as the name of the button changes everytime you go to the page so does the value. Now part of the name stays the same but a number changes in the name and its not consecutive. Also there may not be a radio button at all but there maybe lots. think of it this way a list of new things you need to check and delete every hour the radio button selects delete and then you submit them. there maybe none for the hour or 100. this is my problem because unless I know the exact name i cant seem to get them to change maybe someone will know what to do. Here is my code for the exact name system to change the radio button.

    Please Login or Register  to view this content.
    Let me know how i can select them if i dont know there name.

  2. #2
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8
    Ok so i think i maybe getting closer if I can just get the code to work.
    Based off some code i have ised previously i cam up with this:
    Please Login or Register  to view this content.
    Unfortunatly this did not work either as VControl is for VB and not for java i realy dont know what to use in its stead. IE.Doc dosnt work either as far as i can tell this only signifys the html doc not the form itself. So i guess i have to conintue working on this any added info anyone can provide would be great.

  3. #3
    Registered User
    Join Date
    07-31-2008
    Location
    Regina
    Posts
    8
    Still working on getting this right have not been able to get any closer than the last post in getting this to work. Any help would be appriecated

  4. #4
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Hi Manni.

    Please post the HTML source. There are a number of ways to obtain a reference to an element without knowing the name.

    What is the criteria for setting the values of your input elements to true? Are they all true? Are the radiobuttons grouped in such as way that selecting one sets the value of others to false?

    Modifying your example...
    Please Login or Register  to view this content.
    To...
    Please Login or Register  to view this content.

  5. #5
    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.

    Please Login or Register  to view this content.
    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.

  6. #6
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Please Login or Register  to view this content.

  7. #7
    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:
    Please Login or Register  to view this content.
    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.

  8. #8
    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...

  9. #9
    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:
    Please Login or Register  to view this content.
    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