Jump to content
Guitz

AutoComplete script

Recommended Posts

I created a script that autocomplete a form but it doesn't work and I don't know why. Could you help me? Thank you

 

HTML code:

<form action="adauga_comentariu.php" method="POST">
            Nume:<input type="text" required name="nume_utilizator" id="nume"><br><br>
            Email:<input type="email" required name="adresa_email" id="email"><br><br>
            Comentariu:<br>
            <textarea name="comentariu" cols="45" id="comentariu"></textarea><br><br>
            <input type="hidden" name="id_model" value="<?=$id_model?>">
            <center><input type="submit" id="adauga" value="Adaugă" style="width: 100px; height: 30px; font-size: 16px;"></center>
        </form>

 

AutoIT code:

#include <IE.au3>

Local $mag = _IECreate("http://localhost/mag/model.php?id_model=8")
Sleep(2000)

Local $nume= _IEGetObjById($mag,"nume")
Local $email= _IEGetObjById($mag,"email")
Local $comentariu= _IEGetObjById($mag,"comentariu")

_IEFormElementSetValue ($nume,"Test")
_IEFormElementSetValue ($email,"test@test.com")
_IEFormElementSetValue ($comentariu,"Test Test Test Test Test")

 

AutoIT errors:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Andrei\Desktop\emag.ro.au3"    
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023179, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType

Share this post


Link to post
Share on other sites

For me is working right.

#include <IE.au3>

Local $mag = _IECreate("")


Local $sHTML = ""
$sHTML &= '<form action="adauga_comentariu.php" method="POST">' & @CRLF
$sHTML &= 'Nume:<input type="text" required name="nume_utilizator" id="nume"><br><br>' & @CRLF
$sHTML &= 'Email:<input type="email" required name="adresa_email" id="email"><br><br>'& @CRLF
$sHTML &= 'Comentariu:<br>' & @CRLF
$sHTML &= '<textarea name="comentariu" cols="45" id="comentariu"></textarea><br><br>' & @CRLF
$sHTML &= '<input type="hidden" name="id_model" value="<?=$id_model?>">' & @CRLF
$sHTML &= '<center><input type="submit" id="adauga" value="Adauga" style="width: 100px; height: 30px; font-size: 16px;"></center>' & @CRLF
$sHTML &= ' </form>' & @CRLF



_IEDocWriteHTML($mag, $sHTML)


Local $nume= _IEGetObjById($mag,"nume")
Local $email= _IEGetObjById($mag,"email")
Local $comentariu= _IEGetObjById($mag,"comentariu")

_IEFormElementSetValue ($nume,"Test")
_IEFormElementSetValue ($email,"test@test.com")
_IEFormElementSetValue ($comentariu,"Test Test Test Test Test")

Saludos

Share this post


Link to post
Share on other sites

Is the local web server up and running?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-03-02 - Version 1.3.5.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-01-22 - Version 0.1.0.0) - Download - General Help & Support
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

For me is working right.

#include <IE.au3>

Local $mag = _IECreate("")


Local $sHTML = ""
$sHTML &= '<form action="adauga_comentariu.php" method="POST">' & @CRLF
$sHTML &= 'Nume:<input type="text" required name="nume_utilizator" id="nume"><br><br>' & @CRLF
$sHTML &= 'Email:<input type="email" required name="adresa_email" id="email"><br><br>'& @CRLF
$sHTML &= 'Comentariu:<br>' & @CRLF
$sHTML &= '<textarea name="comentariu" cols="45" id="comentariu"></textarea><br><br>' & @CRLF
$sHTML &= '<input type="hidden" name="id_model" value="<?=$id_model?>">' & @CRLF
$sHTML &= '<center><input type="submit" id="adauga" value="Adauga" style="width: 100px; height: 30px; font-size: 16px;"></center>' & @CRLF
$sHTML &= ' </form>' & @CRLF



_IEDocWriteHTML($mag, $sHTML)


Local $nume= _IEGetObjById($mag,"nume")
Local $email= _IEGetObjById($mag,"email")
Local $comentariu= _IEGetObjById($mag,"comentariu")

_IEFormElementSetValue ($nume,"Test")
_IEFormElementSetValue ($email,"test@test.com")
_IEFormElementSetValue ($comentariu,"Test Test Test Test Test")

Saludos

For me isn't working this code

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Andrei\Desktop\test.au3"    
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023179, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IEDocWriteHTML, $_IESTATUS_InvalidObjectType (Expected document element)
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-2 Error from function _IEGetObById, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType
>Exit code: 0    Time: 0.9284

 

Share this post


Link to post
Share on other sites

this is the code

#include <IE.au3>

Local $mag = _IECreate("http://localhost/mag/model.php?id_model=8")


Local $sHTML = ""
$sHTML &= '<form action="adauga_comentariu.php" method="POST">' & @CRLF
$sHTML &= 'Nume:<input type="text" required name="nume_utilizator" id="nume"><br><br>' & @CRLF
$sHTML &= 'Email:<input type="email" required name="adresa_email" id="email"><br><br>'& @CRLF
$sHTML &= 'Comentariu:<br>' & @CRLF
$sHTML &= '<textarea name="comentariu" cols="45" id="comentariu"></textarea><br><br>' & @CRLF
$sHTML &= '<input type="hidden" name="id_model" value="<?=$id_model?>">' & @CRLF
$sHTML &= '<center><input type="submit" id="adauga" value="Adauga" style="width: 100px; height: 30px; font-size: 16px;"></center>' & @CRLF
$sHTML &= ' </form>' & @CRLF



_IEDocWriteHTML($mag, $sHTML)


Local $nume= _IEGetObjById($mag,"nume")
Local $email= _IEGetObjById($mag,"email")
Local $comentariu= _IEGetObjById($mag,"comentariu")

_IEFormElementSetValue ($nume,"Test")
_IEFormElementSetValue ($email,"test@test.com")
_IEFormElementSetValue ($comentariu,"Test Test Test Test Test")

 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Could we maybe find out a diffrence in iexplore here?

it could be you use a really recent or windows 10 related thing that makes the diffrence?

Long story short, could you tell us our iexplore version since iexplore is used for the used UDF

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

×
×
  • Create New...