473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

passing form variables between pages - not another searchstring question :)

Hello,

I've got a form that runs over 5 pages. I need the last page submit
button to post all of the answers at one time from the previous 5 pages
(to another server). I'd like to see the last page of the form post all
answers in clean ?= format as though all form elements were from one
page.

I use GET to pass name/value pairs from the first to the second page
because no JS is needed to use Get once, and then I use a single hidden
form element on each following page to store all of the
"searchstring(1)" into it. That way, it gets passed along with the new
form elements.

As you can imagine though, my URL gets pretty messy and really long. I
do not want to use cookies because of compatility limitations. Frames
are out of the question because I only have access to body content on
each templated page. How can I get the result I want?

I figure I could do something to the content before I set it to the
hidden value (like split(&)), but that only cleans it up a little. And
then I'm unescaping and other weird stuff. I still have spaces in
textareas, and @ characters in email addresses don't get cleaned up by
unescape for some reason.

Is it possible to make an array of the previous passed variables, then
cycle through an array in a for-loop and automatically make more hidden
fields with values loaded? Do button types from the previous page
matter? I could maybe make them all text fields. The names of the text
fields would be enough to understand the values. Would this work? How
would I do this?

Here's my current script (placed in the body) in pages 2-5 of my form
questionnaire:
<script language="Javascript">

function PassedVars() {

// capture previous answers from address bar AND
// set the new value for the hidden field called PrevAnswers
document.forms[0].PrevAnswers.value = (location.search.substring(1));

document.forms[0].submit();
}
</script>

<form name="Survey" action="/section3_feature-review/" method="get">
<INPUT TYPE="hidden" NAME="PrevAnswers">
....more form elements for the new page
<input name="SendOn" type="button" value="Continue to Section 3 of 5"
onClick="PassedVars()" />
</form>

Thank you. Any input of direction is really appreciated. I'm on day 3
of trying to do this!

William

Nov 23 '05 #1
1 2253
> I've got a form that runs over 5 pages. I need the last page submit
button to post all of the answers at one time from the previous 5 pages
(to another server). I'd like to see the last page of the form post all
answers in clean ?= format as though all form elements were from one
page.


If you have a server these pages are being served from you could create
several hidden form elements by cycling through the GET query string
(in PHP, for example, use foreach ($_GET as $var => $val) )

If you don't you can parse the query string using something like the
code at
http://www.openjsan.org/doc/a/au/aut....14/index.html
then create the hidden elements using standard DOM methods.

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Matthew Robinson | last post by:
i read a tutorial the other day on passing variables between php pages using a html form and setting the action to the php page to parse, can anybody see anything wrong with the code below? the...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
6
by: Eric Johnston | last post by:
I want the visitor to enter three numbers on the page and then click a button "generate image" which will I hope cause a generated gif image to be displayed alongside on the page. This involved...
4
by: Doruk | last post by:
The problem that we are experiencing is simple: We want to pass certain parameters from a page with several server controls to another page. We want to do this in a dotnet compliant manner,...
1
by: Eric | last post by:
Hello, I am trying to come up with the best way to pass large amounts of data from page to page, namely a data table. The user needs to enter data into a form in one page and confirm it on...
7
by: Khai | last post by:
First off, yes, I understand the crapload of tutorials out there, (well, rather, I understand there /are/ a crapload of tutorials out there), the problem is my comprehension. I'm trying to pass...
28
by: Skeets | last post by:
i'm passing session and hidden variables between pages. not to mention post values. i'm a little concerned that someone with sufficient knowledge could spoof these vlaues and manipulate the...
6
by: coool | last post by:
Hi :) anyone knows how can I send variables from a php page to a form - i need to fill the form with these variables ? maybe using (the process of passing variables to other pages - through...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.