Jump to content
Sign in to follow this  
hessebou

_IEFormElementSetValue

Recommended Posts

hessebou

hello, if i want to put this to a form:

_IEFormElementSetValue ($otitle, "abcdefgüüüüürrrr")

for example, the result is "abcdefg" it was cut where the ü starts.

what is wrong here?

Share this post


Link to post
Share on other sites
sandin

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.

Share this post


Link to post
Share on other sites
hessebou

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

Share this post


Link to post
Share on other sites
sandin

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  

×