Jump to content
Sign in to follow this  
xerxes717

Set text field in IE with no form name

Recommended Posts

xerxes717

Hi all, this is my first post here and I have a really basic question: How can I set the value of a text field inside a form in IE when the form doesn't have a name?

Let's say the text field whose value I'm trying to set it is called "textField".

My code is as follows:

#include <IE.au3>
$oIE = _IECreate("http://www.something.com",0,1,1,0)
$oForm = _IEGetObjByName($oIE, "textField")
$oForm.value = "Set this text in the text field"
_IEFormSubmit ($oForm)

What am I doing wrong? This code just opens the browser with the correct URL and then appears to hang (the script appears to still be running, or paused rather as indicated by the Autoit icon in the system tray).

Thanks in advance!

PS - I'm using IE7, Autoit Beta and Scite

Share this post


Link to post
Share on other sites
xerxes717

I think i figured out the solution myself - I had set the window to finish loading before setting the text field and for some reason the script never figured out when the page had finished loading. That's why it never went any further in the script. When I changed the _IECreate function to not wait to load, the text field starting being set correctly.

Thanks.

Edited by xerxes717

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.