Archived Forum Post

Index of archived forum posts


Duplicating a Post form with more arguments

Aug 18 '14 at 10:16

Hi there,

I need to duplicate a form like this one:

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

I thank you very much in advance!


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 "", 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 "", then the full url would be "". 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();

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.