cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to send form NAME, -d? -F?, when multiple forms/page

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Tue, 30 Aug 2005 04:06:53 -0500

On 8/30/05, Kjell Ericson <Kjell.Ericson_at_haxx.se> wrote:
> On Mon, 29 Aug 2005, Frank Harvey wrote:
>
> > The web pages I'm looking at have more than one form
> > per page and each form is given a distinctive name.
>
> > The -d type of curl transfer seems simpler and, thus I presume, would be
> > more favored _IF_ there were a way to specify the form name ("RENT" or
> > "BUY").
>
> You can specify -d several times to declare each field to post.
>
> Note that your browser (at least mine) doesn't send any information about
> which form that is posted. Only the content within the form. So your problem
> is not existing.
>
> A browser do not either post two forms at the same time, so I don't see the
> need to try that either.
>
> // Kjell
>

This is true. I think the only reason a form needs to be named in the
web page is so that a scripting language in the browser can fiddle
with the contents. I've certainly seen a lot of that, and I've never
had to post the form name back...

And when you click the submit button, only the form is belongs to is
submitted. If the user fills out any fields in a different form on
the same page, the values would be lost *unless* there's a script
there which moves form values around during the submit. Seen that
too, though not between two forms in the same page.

Ralph Mitchell
Received on 2005-08-30