[WEB4LIB] Passing variables from one form to another

Thomas Dowling tdowling at ohiolink.edu
Fri Apr 23 09:19:45 EDT 1999


You're already using CGI; it will be simplest just to use what it offers.

The typical way to do this is to have a script take inputs from the first
form, and write out the second form on the fly.  The second form then
carries forward any data you need with hidden inputs.  So the first form
might have:

...Your First Name: <input name="firstname"><br>
Your Last Name: <input name="lastname">...

And the second form could then have:

...<input type="hidden" name="firstname" value="Tim">
<input type="hidden" name="lastname" value="Tripp">
What is your favorite color? <input name="fave_color">...



Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu


----- Original Message -----
From: Tim Tripp <ttripp at inforamp.net>
To: Multiple recipients of list <web4lib at webjunction.org>
Sent: Thursday, April 22, 1999 9:24 PM
Subject: [WEB4LIB] Passing variables from one form to another


> Greetings Gentlefolk,
>
> I'm working on a project where I'm taking information from web based
forms to input
> into a database.  I actually require the same bit of information to be
submitted
> twice, from separate forms, so I'm wondering if there is a way to pass a
variable
> submitted in one form to the next form.
>
> Both forms are submitted to the same cgi program for data formatting and
saving on
> the server.  The cgi program then redirects to a specified page - in
this case the
> second form.
>
> I suspect that there is some javascript method for doing this, but my
experience with
> javascript only extends to finding scripts I can use, and modifying them
> appropriately.  I'm not really up for learning the language just yet.
>
> Any help would be greatly appreciated.
>
> Cheers,
>
> Tim
>
> --
> Tim Tripp. Librarian.
>
> Work: ttripp at spar.ca
> Home: ttripp at inforamp.net
> http://www.inforamp.net/~ttripp
> SLA Toronto Chapter - Now with flavor crystals!
> http://www.sla.org/chapter/ctor/
>
> ### There is a crack in everything.
> ### That's how the light gets in.
>                           - Leonard Cohen
>



More information about the Web4lib mailing list