Forum Moderators: open

Message Too Old, No Replies

Multiple Page Form

         

techoveride

6:15 pm on Dec 5, 2006 (gmt 0)

10+ Year Member



I am needing an online form that consists of multiple sections and is fairly long. I was going to make a page with a tab for each section of the form to break it down some. But I am not sure how to make a multpile page form work with one submit button.
Any help would be greatly appreciated.

tedster

6:30 pm on Dec 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A Site Search [google.com] turns up lots of discussion here on the topic.

techoveride

7:27 pm on Dec 7, 2006 (gmt 0)

10+ Year Member



I am still really confused - I know how to create a forms page but how would I link them together?

Trace

9:22 pm on Dec 8, 2006 (gmt 0)

10+ Year Member



I would probably build the entire form in 1 page and then divide it up with layers. Then your "tabs" could just show/hide the appropriate layer. It's still essentially one page with one form but it's not as intimidating.

Another way would be to do it with multiple pages. Have only a section of your form on the first page and then submit that to the second page. Retrieve the posted data on the second page and place it in hidden fields - then add another section of your form to this page and submit to page 3. Just keep doing that until you've collected all the data.

techoveride

4:17 pm on Dec 11, 2006 (gmt 0)

10+ Year Member



How do you divide 1 page into separate layers?

rocknbil

6:28 pm on Dec 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tech don't do that, it most likely would involve the use of Javascript and would render your form inaccessible by non-Javascript browsers.

The way you do a multiple page form is to store or pass the information from the first pages along to subsequent pages.

In the initial page, you can set a session id and cookie to "track" the visitor as they pass from page to page. On each submit, the information is stored in a database associated with the cookie you set. As a bonus you can have them choose a login ID and password on the first page of the form, this would allow them to return at a later time and finish the form.

A more simple but less secure way is each time they submit info, store all of the data in the next form as a hidden field. This requires that your subsequent forms be output as a part of the script. Perl example,

# Create hidden fields for all submitted data
foreach $v (keys %qs) {
if ($qs{$v}) {
$hiddens .= qq¦<input type="hidden" name="$v" value="$qs{$v}">\n¦;
}
}

print "content-type: text/html\n\n";
print qq¦
<form method="post" action="yourscript">
<input type="text" name="some-field">
<input type="hidden" name="step" value="2">
$hiddens
</form>
¦;

There are many other ways if you search about, but simply put you need a method to store the data from previously submitted pages on each subsequent page.

piatkow

9:23 am on Dec 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You will need to use a scripting language somewhere along the line. If server side scripting is available to you then that is the best way to go. If your hosting package does not include a server side language then you will need javascript.

If we knew what restrictions you were working under regarding scripting languages somebody could give a far better targetted reply.