Jump to content
Sign in to follow this  

IE: How to wait for JavaScript to complete

Recommended Posts

I have a pop-up form which has a drop-down list and several input elements. Let's call them InpA, InpB and InpC. Manually, the user selects an option from the drop-down list. InpA then disappears from the screen, and the widths (and probably positions) of the other input boxes change.

I can see, looking at the HTML, that Javascript runs when a drop-down option is selected.

My script needs automate it -- to wait/sleep until the Javascript has run completely -- put another way, until InpA has disappeared from the screen, and the other input boxes have been resized.

But how can I do this?

I have looked at the HTML before and after selecting from the drop-down. I see that while

<select name="InpA" onchange=" ...CodeForm, 'get... .do')" class="f_textfield"><option value="">
is there before selecting, it is not there afterwards.

But consider this AutoIt code:

If _IEFormElementOptionSelect($oSelect, "selection", 1, "byText") <> 1 Then; select
MsgBox(4096, $macroname, "_IEFormElementOptionSelect: @error = " & @error)

MsgBox(0,"",IsObj( _IEFormElementGetObjByName($oForm, "InpA")))

I find that the MsgBox shows 1 independent of whether the _IEFormElementOptionselect code is there or not.

Any suggestions?

Edited by c.haslam


CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard


Share this post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...