Jump to content

_IEFormElementSetValue


Recommended Posts

try this script:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 400, 300)
$edit1 = GUICtrlCreateEdit("", 0, 0, 400, 280)
GUICtrlSetFont(-1, 18, 800, -1, "Arial")
$Button1 = GUICtrlCreateButton("Get me char codes", 0, 280, 400, 20)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            exit
        case $Button1
            Local $split_strings = StringSplit(GUICtrlRead($edit1), "")
            _display_chars($split_strings)
    EndSwitch
WEnd

func _display_chars($letters)
    Local $display = ""
    for $i = 1 to $letters[0]
        $display &= "ChrW(" & AscW($letters[$i]) & ") & "
    Next
    $display = StringTrimRight($display, 3)
    Local $form_x = GUICreate("Your chars:", 500, 80)
    Local $edit_x = GUICtrlCreateEdit($display, 0, 0, 500, 80)
    GUICtrlSetFont(-1, 18, 800, -1, "Arial")
    GUISetState(@SW_SHOW)
    Do
        Sleep(10)
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete($form_x)
EndFunc

it will transform your chars from üäö to: ChrW(252) & ChrW(228) & ChrW(246)

and use ChrW in scite instead of actual typing those chars.

Link to comment
Share on other sites

within your script chrW works, but not if i try to fill my html. exact case is:

<form action="http://de.sevenload.com/bigbrother/forum/new/post/
NLZu6Uk
" method="post" name="auto" accept-charset="UTF-8"><input type="text" name="title" id="fe-title" value="
glühwein
" /><textarea name="text" id="fe-text" rows="10" cols="50"></textarea><input type="submit" name="confirm" value="Senden" /></form>

if i load this html-code (could be a file on my machine) manually with my browser and click "senden", the word "glühwein" is correctly shown

in the sevenload-forum.

if i try this script-part here:

_IENavigate ($oIE, @TempDir & "\auto.htm")
         $oForm = _IEFormGetObjByName ($oIE, "auto")
         $otitle = _IEFormElementGetObjByName ($oForm, "title")
         $oQuery = _IEFormElementGetObjByName ($oForm, "text")
         _IEFormElementSetValue ($otitle, "glühwein")
         _IEFormElementSetValue ($oQuery, "test")
         _IEFormSubmit ($oForm)

the word "glühwein" isnt there, only the first two letters "gl".

Edited by hessebou
Link to comment
Share on other sites

try this:

_IENavigate ($oIE, @TempDir & "\auto.htm")
         $oForm = _IEFormGetObjByName ($oIE, "auto")
         $otitle = _IEFormElementGetObjByName ($oForm, "title")
         $oQuery = _IEFormElementGetObjByName ($oForm, "text")
         _IEFormElementSetValue ($otitle, "gl" & ChrW(252) & "hwein")
         _IEFormElementSetValue ($oQuery, "test")
         _IEFormSubmit ($oForm)
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...