Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Pass field values from one page to another.

Quote Reply
Pass field values from one page to another.
I have a website with a single template page (eg. template.html) and on this page I have a two page form. So basically the "do" action on the first page is "add_form" then on the second page it is "add_record". I separate the two pages (even though it is the same HTML template) with an IF statement so that if the second page sees the value from the first page it will display the second half of the block. This works well for multiple page forms and it allows you to do conditional forms depending on previous input entries (without a bunch of DHTML and javascript).
Code:

<%if page1field1%>
Second set of form fields.
<%else%>
First set of form fields.
<%endif%>

Here is my question: Is there a global variable that I can create that will automatically create the "hidden" form elements from the first part of the page? Right now I am manually doing "hard coded" hidden forms like this on the second page:

Code:
<input type="hidden" name="page1field1" value="<%page1field1%>">


On each page I do a HIDDEN tag with the previous form's fields on it. Can somebody help me generate a Global Template that will automatically create the previous pages FORM fields (as hidden fields) rather than me hard coding each page?

P.S. I can already see that there are some fields, like "do", that we don't want brought over to the second page, because they will change.
Subject Author Views Date
Thread Pass field values from one page to another. LanceWilson2 3293 Apr 14, 2005, 10:28 AM
Thread Re: [LanceWilson2] Pass field values from one page to another.
604 3165 Apr 15, 2005, 3:54 PM
Thread Re: [TheStone] Pass field values from one page to another.
LanceWilson2 3166 Apr 15, 2005, 4:58 PM
Thread Re: [LanceWilson2] Pass field values from one page to another.
socrates 2960 Dec 16, 2005, 10:57 PM
Post Re: [socrates] Pass field values from one page to another.
LanceWilson2 2932 Dec 30, 2005, 12:43 AM