Jump to content
Sign in to follow this  
lolp1

Help with _IEFormSubmit

Recommended Posts

lolp1

Hi, need some help using the _IEFormSubmit.

On some forums I use, before you make a post you need to of course click the Add Reply button, and I'm trying to auto-mate 1 post. I seem to have some problems with _IEFormSubmit

In the example it shows:

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

How ever I'm not sure why it's using, $oForm = _IEFormGetObjByName ($oIE, "f")

What is the F for? The button name is Add Reply if thats any help...

Share this post


Link to post
Share on other sites
d4rk

"f" is the Form name, in html code, it's

<Form name="f">


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
lolp1

"f" is the Form name, in html code, it's

<Form name="f">

Ok, but how is "f" getting the func to click on "Google search"?

How do I go about getting the proper form name for the button I want to press?

Share this post


Link to post
Share on other sites
PsaltyDS

Hi, need some help using the _IEFormSubmit.

On some forums I use, before you make a post you need to of course click the Add Reply button, and I'm trying to auto-mate 1 post. I seem to have some problems with _IEFormSubmit

In the example it shows:

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

How ever I'm not sure why it's using, $oForm = _IEFormGetObjByName ($oIE, "f")

What is the F for? The button name is Add Reply if thats any help...

A form contains elements (which could be more forms), similar to a GUI containing controls. The demo script gets an object reference to $oIE which is the IE document (more specifically, the Document Object Model, or DOM). Then it gets the object reference $oForm, which is the form named "f" contained in $oIE. Next it gets the object reference to the element "q" at $oQuery and sets that to a value.

Lastly, it sends a "submit" command to the form object $oForm. Some forms are coded in their HTML to act on that, some are not. The google page is, and that script works fine. The form you are actually working with may not accept "submit", but may need a more specific action, like getting the object reference to an input button element and doing _IEAction($oButton, "click").

The remaining issue is how to identify the objects you need to work with. One answer is to just view the source from the browser (Ctrl-U in Firefox, I don't know the shortcut in IE). Another answer with more power is DebugBar for IE, or DOM Inspector for Firefox.

To go on with this, you need to educate yourself on the basics of the DOM for IE, since that is what AutoIt's IE.au3 is based on. There is no equivelent Firefox.au3 yet, and no prospect of one soon.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×