Sign in to follow this  
Followers 0
RAMMRODD

Filling In an Input Box in IE

7 posts in this topic

; *******************************************************

; Example 1 - Open a browser with the form example, set the value of a text form element

; *******************************************************

;

#include <IE.au3>

;$oIE = _IECreate ("http://mobsterstrategy.com/mobadd.php")

$oIE = _IE_Example ("FORM")

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oText = _IEFormElementGetObjByName ($oForm, "MySpaceID")

_IEFormElementSetValue ($oText, "Hey! This works!")

This is literally out of the help file with my input "commented out". It may not be proper but it opens the IE browser at goes to the website, but it doesnt fill in the Input box. I viewed the source code and found the input box's "name" but thats not working. Any help would be appreciated. I commented out the line I added so its in its "stock" form except for changing the ID. I want it to go to that website and enter numbers in the input box and submit.

Thanks

Share this post


Link to post
Share on other sites



This works...

; *******************************************************
; Example 1 - Open a browser with the form example, set the value of a text form element
; *******************************************************
;
#include <IE.au3>
;$oIE = _IECreate ("[url="http://mobsterstrategy.com/mobadd.php"]http://mobsterstrategy.com/mobadd.php[/url]")

$oIE = _IE_Example ("FORM")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
$oText = _IEFormElementGetObjByName ($oForm, "textExample")
_IEFormElementSetValue ($oText, "Hey! This works!")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

This will work for your site...

; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("[url="http://mobsterstrategy.com/mobadd.php"]http://mobsterstrategy.com/mobadd.php[/url]")

$oForm = _IEFormGetObjByName ($oIE, "form1")
$oText = _IEFormElementGetObjByName ($oForm, "MySpaceID")

_IEFormElementSetValue ($oText, "15591113")

$oBotton = _IEGetObjByName($oForm, "Submit")
 _IEAction($oBotton, "click")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm not home, but thanks for the reply I'll test it then.

EDIT: That didnt work...I probably found the wrong name of the box....how do I do that? Or can someone double check for me either way is great. My way was just with the HTML source....

Edited by RAMMRODD

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I tested that code ( my code above )... it works

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

so you run the script and it goes to the site enters in the numbers and submits it? When i try it it opens up 2 IE windows maximizes 1 of them goes to the site, and then nothing....Did I run it wrong?

Share this post


Link to post
Share on other sites

Vista perchance? Please see the remarks for _IECreate in the helpfile.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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  
Followers 0