Jump to content

[Resolved] _ieaction(object, "focus") problems - ie7

Recommended Posts

I'm working on a project that will fill in form data into a web page and submit the data.

No problems entering data, but when it comes to getting to the submit button - can't make it happen.

I tried setting the focus to the button and hitting the space or enter keys and this works...some of the time. It will not work 100% of the time.

I tried using tab, space to tab a way from the last entry field and onto the button - this works...some of the time, but not 100% of the time. Works less often than the focus.

I tried formsubmit - this is about as frequently working as the focus.

When I took my code to a seperate script and ran that - as long as the IE window has focus - it runs fine. I even looped it 100 times and it ran 100/100 as long as the IE window had focus. Unfortunately if you minimize or load the window hidden it fails.

Does anyone have any solution options in mind?

Before you ask, no I can't show the html for the page - internal proprietary work tool. :\ But I can say it's written in general html form layout if that is useful any.

Edited by xeroTechnologiesLLC
Link to post
Share on other sites

I have figured out that if the program is starting brand new it works 100% of the time, but if I rerun the process to gather the data I want to gather - it fails after the first time.

So along this line of thinking I wrote a function to clear all variables and close up all the arrays back to 0. Issue remains. It will work once, then if the program is left open the focus does not work the second, third or nth time.

Link to post
Share on other sites

Is there a way to error check focus?


if the object you set to have the focus doesn't have focus - redo the focus control till it does?

I'd even take a way to have a message box pop up and tell me what does have focus if anyone could direct me towards how to make that happen.

I'm still confused why the program runs fine the first time, but any time after that it's like the ie7 obj isn't working right or something.

Link to post
Share on other sites

Well, after having some more points of view on the matter here in house I figured out that I had a variable that was not clearing correctly after the initial time the program ran. I was using a time variable to tack onto the end of a report name that was polling every time the program ran. The problem was the variable was right only for the time the program ran - not every time the function ran. /face palm/ :) So when the program entered the information for the report, it saw there was a duplicate and didn't actually run the report (hence why I thought it was a focus on the ADD REPORT button problem).

So..yeah, just ignore the noob. Just passing through... ;)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...