login about faq

Hi there,

I need to duplicate a form like this one:

<form action="http://sumdomain.domain.ro/directory" method="post">
<input type="hidden" name="link-back" value="http://sumdomain.domain.ro/directory" readonly="readonly" />
<input type="button" value="No" onclick="document.location='http://sumdomain.domain.ro/';" />
<input type="submit" value="Yes" name="submit-disclaimer" style="margin:0 0 0 20px;" />
</form>

I thank you very much in advance!

asked Aug 14 '14 at 06:08

Scienceman's gravatar image

Scienceman
11

what do you mean by duplicate the form?

(Aug 14 '14 at 07:44) jpbro ♦

I need to transmit a http post, by clicking on Yes submit button

(Aug 16 '14 at 09:03) Scienceman

The simplest way to duplicate the HTTP POST is via the PostUrlEncoded method, which takes two arguments: a URL and an HttpRequest object. The URL is the form's action. In this case the form action is "http://sumdomain.domain.ro/directory", which is already a full URL. If the form action is only a relative path, then you must use add the domain to make it a full URL. For example, if the form action is "/directory", and the HTML containing the form is located on "somedomain.domain.ro", then the full url would be "http://somedomain.domain.ro/directory". If you need SSL/TLS, then simply use "https://" in the URL.

Each of the "input" fields corresponds to a parameter in the HttpRequest object. Prior to calling PostUrlEncoded, construct your HttpRequest object:

Chilkat.HttpRequest req = new Chilkat.HttRequest();
req.AddParam("link-back","http://sumdomain.domain.ro/directory");
req.AddParam("submit-disclaimer","Yes");
...

If an HTML input field uses Javascript to dynamically set the name/value, then you'll need to pre-determine a correct value because there is no Javascript involved (nor is there a full HTML document involved) with the HTTP request constructed and sent via the Chilkat HTTP and HttpRequest objects.

link

answered Aug 18 '14 at 10:16

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26
×3

Asked: Aug 14 '14 at 06:08

Seen: 738 times

Last updated: Aug 18 '14 at 10:16

powered by OSQA