wrote:
> Hi, friends,
>
> First please take a look at my sample HTML page at:
>
> http://members.lycos.co.uk/wodesite/
>
> Each of the tabs is linked to its corresponding HTML form page. One
> can browse each form by clicking on the tabs.
>
> Those pages are actually gonna be HTML forms in which the user supplies
> his personal info and then click a "submit" button to send the info to
> the database.
>
> Now, I want to be able to collect all in once all the user-input data
> from all of the separate HTML forms linked to the tabs, and then do a
> single "submit" action to send the data to the database.
>
> But, I am not sure how I can get such user-input data in different HTML
> forms all in once. Any solution to this problem? Thanks.
>
> I know that it is doable if I combine all the forms into a single HTML
> page, but then I will have a very lengthy form, which eventually ruins
> the beauty or the advantage of the tabs I've created.
>
> Please ask if I did not make it clear what I wanna do.
Two possible options:
1.) You create a single, large form. You could 'simulate' several pages by
showing only a part of it at a time and hiding the rest of it (using CSS).
The page switching will involve JavaScript, so make sure that a user agent
without JS will always see the full form without hidden parts. There may be
some issues with form values not being sent, if the corresponding input
element is not visible when the form submitted (I think, I remember
something like this, but I'm not sure, so better do some research on this
topic. At least this approach is possible, as I've seen it various times
'in the wild'). Finding a good, understandable way to indicate
missing/wrong data is probably quite a challenge.
2.) Convert the link that point to different parts of the form into submit
buttons. Collect the data, but do not write it to the DB - store it in
session variables or create hidden input fields to carry the values through
all forms.
The first approach is faster, as no additional page reloads are needed. But
an implementation is not for the faint-hearted. The second approch is more
robust and the one I would choose (and have often implemented).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW:
http://www.odahoda.de/