Jump to content

Other Ways To Submit a Form Besides _IEFormSubmit($Form)..?


Recommended Posts

Are there any other ways to submit a form if _IEFormSubmit($Form) doesn't work..??

is there anyway to find the "Input type=submit" in the $Form object reference and then use that to submit the form..??

Something like

$GetFormInputs = _IETagNameGetCollection($Form, 'input')
For $Input in $GetFormInputs
If $Input.type = "submit" Then (Somehow Submit $Form..??)
Next
Link to comment
Share on other sites

Is there anyway to get an object reference to the Submit button by doing

If $Input.type = "submit" Then $Submit = $Input.name
_IEAction($Submit, 'click')

or somthing along the lines of that by searching for the $Input.type = "submit" in the form..??

Link to comment
Share on other sites

Sumthing like this or what..??

For some reason the Submission of the Form on this page http://www.charlietheunicorn.info is being a pain in the biatch...

think you can help me figure out why my code ain worken to submit that biatch..

#NoTrayIcon
#include <IE.au3>
#include <Misc.au3>
_Singleton(@ScriptName)

$IE = _IECreate ("http://www.charlietheunicorn.info",0,1,1,0)

$FindForm = _IETagNameGetCollection($IE, 'form')
For $Form In $FindForm
    
    If StringInStr($Form.Action, 'index.php') Then 
        $GetFormInputs = _IETagNameGetCollection($Form, 'input')
        For $Input in $GetFormInputs
            If $Input.type = "text" Then $Input.value = "http://www.url.com"
            If $Input.Type = "submit" Then _IEAction($Input, 'click')
            ExitLoop 2
        Next
    EndIf
next
Link to comment
Share on other sites

thanx, but im trying to submit the form without using either :

Dim $oQuery = _IEGetObjByName($oIE, 'q')

Dim $oSubmit = _IEGetObjByName($oIE, 'submit')

im trying to do it on a blind bases by searching the form for certain things like "If $Input.type = "text" Then $Input.value = "http://www.url.com"

and

If $Input.Type = "submit" Then _IEAction($Input, 'click')

Link to comment
Share on other sites

There you go, I still don't see the point:

#include <IE.au3>

Dim $sURL = 'http://www.autoitscript.com'
Dim $oIE = _IECreate('http://www.charlietheunicorn.info/')
Dim $oForms = _IEFormGetCollection($oIE)
Dim $oInputs

For $oForm In $oForms
    If StringInStr($oForm.Action, 'index.php') Then
        $oInputs = _IETagNameGetCollection($oForm, 'input')
    
        For $oInput In $oInputs
            $oInput.ScrollIntoView()
            Switch $oInput.Type
                Case 'text'
                    _IEFormElementSetValue($oInput, $sURL)
                Case 'submit'
                    _IEAction($oInput, 'click')
                    ExitLoop(2)
            EndSwitch
        Next
    EndIf
    Sleep(50)
Next
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...