Forum Moderators: open

Message Too Old, No Replies

posting an entire form again

without making lots of hidden form stuff

         

natty

2:14 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



hi all,

as the name of the post suggests, i am wondering if anyone knows if this is possible, i am guessing not.

but just to ask.
can i post an entire form onto another page without:
1. hidden form fields
2. posting it all to the querystring
3. sticking it all in the session somewhere

anyone have any cuning ways to do this using none of the above..

tia

nathan

mrMister

11:07 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would help if you could explain what you're actually trying to achieve and the reasons why you're excluding the options you've mentioned.

natty

10:40 am on Mar 11, 2005 (gmt 0)

10+ Year Member



hi,

thanks for the reply. sorry the question was a little cryptic maybe.

imagine if you will a form on a page, in a multi page form process thingy.
i simply want to hold on to all the form data through the steps without having to make a whole load of hidden fields or stick the whole lot in the session.

i dont want to use the session because, well id just rather not, and although making lots of hidden form fields isnt a problem as such, i was just wondering if there was another way..
thats all ...

tia

nat

aspdaddy

11:25 am on Mar 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could write to a tempory database or text file.

Regarding the hidden form elements, it is a lot of effort and prone to bugs on large forms but you could optimise this by looping over the entire form collection and then package the code into a re-usabale function.


Public Sub CopyForm()
dim f
%><form action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method=post id=form2 name=form2><%
for each f in Request.Form
%><input type="hidden" name="<%=f%>" value="<%=Request(f)%>"><%
next
%></form><%
End Sub

if request("STAGE")="Confirm" then
call copyForm()
end if

natty

2:35 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



hi aspdaddy,

yeah i had something similar to that, but , and it was just a wonder really, if there was another way to do this.
as you say, it seems rather carpet bomby to me to refill the page with the last page form. i do of course have nice little form element building functions so it is not a huge problem, just thought there may be a quick and cunning way to do it in 1 foul swoop.

i guess i was after something like..

nextPage Request.Form = LastPage Request.Form
type thing..btw i realise that what i have written above is nonesensical dream :)

thanks again as always

nat

mrMister

5:21 pm on Mar 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You seem to be trying to ask if there is a way of maintaining state without maintaining state!

The answer is no.

You need to store the data somewhere!

You either store it all in one place (the page requests) or you use a session identifier. Either way you are still storing the data.

There's no other way of doing it. The physics of this universe don't allow it!

There's many different ways to implement sessions (don't let Microsoft fool you in to thinking that the Session object is the only way)

It really would help if you would say what you are trying to acheive. That way, we might be able to come up with a solution.