Sign in to follow this  
Followers 0
shaqan

Issue with _IEFormSubmit()

2 posts in this topic

Data seems to be insterted into InputBox on website just fine, but upon form being submitted, string simply disappears and website returns no data. There is some Javascript on site but I haven't managed to find a way for getting past it.

I created basic GUI for illustrating the issue I am stuck with

#include <WindowsConstants.au3>
#include <IE.au3>

Opt("GUIOnEventMode", 1)
;Const $WINTITLE = "Piiriületus"

Local $oIE = _IECreateEmbedded()
$Form1 = GUICreate("needed some GUI", 972, 595, 13, 117, $WS_EX_CLIENTEDGE + $WS_DLGFRAME + $DS_MODALFRAME, $WS_EX_APPWINDOW + $WS_EX_TOOLWINDOW + $WS_EX_WINDOWEDGE + $WS_EX_DLGMODALFRAME)
GUICtrlCreateObj($oIE, 8, 8, 956, 540)

$PullNr = GUICtrlCreateButton("Push me", 8, 552, 75, 25)
GUICtrlSetOnEvent($PullNr, "_Data")

$ExitB = GUICtrlCreateButton("Exit", 888, 552, 75, 25)
GUICtrlSetOnEvent($ExitB, "_Exit")
GUISetState(@SW_SHOW)

_IENavigate($oIE, "https://vs.lkf.ee/pls/xlk/SYSADM.LK_INFOKESKUS_PKT.kindlustuskate")

While 1
    Sleep(10)
WEnd

Func _Exit()
    Exit
EndFunc 

Func _Data()
    ;Local $Data = ControlGetText($WINTITLE,"", "Edit25")
    ;replacement drop-in, since the program from where data is supposedly pulled from
    ; is not available for testing here and now.
    Local $Data = "001AAA"
    Local $oForm = _IEFormGetObjByName($oIE, "kindlustuskate")
    Local $oText = _IEFormElementGetObjByName($oForm, "pregnr")
    _IEFormElementSetValue($oText, $Data)
    _IEFormSubmit($oForm)

EndFunc

Help or helping hints would be appreciated:)

Share this post


Link to post
Share on other sites



See the help entry for _IEFormSubmit, specifically the Remarks section.

You can use the following instead of _IFFormSubmit:

Local $oBtn = _IEFormElementGetObjByName($oForm, "potsi")
_IEAction ($oBtn, "click")

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