Jump to content

_WinHTTPSimpleFormFill @CRLF


AutID
 Share

Recommended Posts

Hello,

I would ask that girl who wrote this udf but I already asked her a lot of things so here we go.
Is it possible to set some data + @CRLF +some other data using this function?

_WinHttpSimpleFormFill($hConnect, _
   "actionpage", _
   "form", _ 
   "id:test", "some text" & @CRLF & "some other text")

Like this??? It doesn't work for me.

Or maybe like this?

_WinHttpSimpleFormFill($hConnect, _
   "actionpage", _
   "form", _ 
   "id:test", "some text", _
   "id:test", @CRLF, _
   "id:test", "some other text")

Won't this erase the previous data of the same form and only submit the last data ("some other text")???
I cant test it atm. Anyone who knows?

Edited by AutID
Link to comment
Share on other sites

There shouldn't be problems with @CRLF. If you are passing "id" then don't pass it as "id:test", pass it just as "test".

So, it would be:

_WinHttpSimpleFormFill($hConnect, _
   "actionpage", _
   "form", _ 
   "test", "some text" & @CRLF & "some other text")
Id is basic identifier.

Still with one of the next updates I will probably allow the syntax you use, for completeness.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

I'm fairly confident it does.
Are you sure the control is <textarea>? If it's not then maybe the server side dismisses your input.
Textarea is multi-line input control.

#include "WinHttp.au3"

; Initialize and get session handle
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "www.htmlcodetutorial.com")

; Fill form
$sHTML = _WinHttpSimpleFormFill($hConnect, "forms/_TEXTAREA.html", _
        "index:1", _ ; form index of textarea example
        "name:comments", "First Line" & @CRLF & "Second Line" & @CRLF & "Third Line" & @CRLF & "...")

If @error Then
    MsgBox(4096, "Error", "Error number = " & @error)
Else
    ConsoleWrite($sHTML & @CRLF)
EndIf

; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

 

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Did you try the code from the post above? It's the example that proves beyond doubt that there are no problems with @CRLF. Write $sHTML to some html file and run it, you shold see that everything is fine as far as WinHttp.au3 is concerned. 

If there are any issues they are probably on server side, maybe it expects some other line break character. @LF or @CRLF are not the only line breaks.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

I dont really have to try it. If you say it works, then im sure it does. I just post that line above so you can see it case there are some debugs.

It is server`s side. That textarea doesnt accept line break even manually if i dont press an icon to change the type of it. Its a rich edit.

Anyway thank, i will do a work arround.

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...