W
williamroy
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
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