Sign in to follow this  
Followers 0
Googler24022

Input into a online form.

6 posts in this topic

#1 ·  Posted (edited)

Hi,

I have started coding in autoitscript again and this time I want to enter values into an online form. I checked out the documentation and it needs a form name for it to work, but the webpage I am trying to enter the information on has no form name.

Posted Image

Is there a way to still enter my values into the form without the form name?

Regards,

-Matt.

Edited by Googler24022

Share this post


Link to post
Share on other sites



Hi,

I have started coding in autoitscript again and this time I want to enter values into an online form. I checked out the documentation and it needs a form name for it to work, but the webpage I am trying to enter the information on has no form name.

Is there a way to still enter my values into the form without the form name?

Regards,

-Matt.

Take a look at _IEFormGetCollection() and _IEFormElementGetCollection(). If there is only one form it's easy to identify "your" form. If there are many forms, you will have to figure out which one is the correct one.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nevermind, just solved it with the

_IEFormGetCollection

function.

[Edit, thanks /dev/null,]

Edited by Googler24022

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Another problem.

#include <IE.au3>
#include <GUIConstants.au3>

HotKeySet("{ESC}" , "Terminate")

GUICreate("Kings of Chaos", 400, 115)  ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)


GUICtrlCreateLabel ("u",  7, 12)
GUICtrlCreateLabel ("e",  7, 38)
GUICtrlCreateLabel ("p",  7, 62)


$username = GUICtrlCreateInput ("", 20,  10, 100)
$email = GUICtrlCreateInput ("", 20,  35, 100)
$password = GUICtrlCreateInput ("", 20,  60, 100, 20,$ES_PASSWORD)

$login = GUICtrlCreateButton ( "Login",  20, 85, 100, 20)



Func koc_login($username, $email, $password)
$oIE = _IECreate ("http://www.kingsofchaos.com")
$oForm = _IEFormGetCollection ($oIE, 0)
$ousername = _IEFormElementGetObjByName ($oForm, "usrname")
$oemail = _IEFormElementGetObjByName ($oForm, "uemail")
$opassword = _IEFormElementGetObjByName ($oForm, "peeword")
_IEFormElementSetValue ($ousername, $username)
_IEFormElementSetValue ($oemail, $email)
_IEFormElementSetValue ($opassword, $password)
_IEFormSubmit ($oForm)
EndFunc

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
    
Func Terminate()
    Exit 0
EndFunc

I have created the login function and the input forms on the GUI to correspond with it. How would I go about making the button submitting the values in the form to the function?

Regards,

-Matt.

Edited by Googler24022

Share this post


Link to post
Share on other sites

Another problem.

I have created the login function and the input forms on the GUI to correspond with it. How would I go about making the button submitting the values in the form to the function?

Regards,

-Matt.

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    if $msg = $login then
        ; see help file sample of GUICtrlCreateButton().
        ; ....
        ; then read the values of the input controls with GUICtrlRead() - see help file sample.
        ; $passwd = GUICtrlRead(...)
        ; then call your function with the parameters.
    endif 
Wend

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Excellent, got it working. Many thanks.

Regards,

-Matt


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