By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

Forms w/ two buttons

P: n/a
YT
Greetings,

Just wondering if someone out there can help with this issue.

I have a questionnaire that i'm building. Each step is a separate web page with a form and a next button & back button, similar to a wizard.

What i would like to do is to make sure that all the information on the form gets retained. i'm doing this via asp & session cookies. So when the user clicks the next button, the form info is submitted and put into session cookies. if the page is redisplayed for whatever reason, the form will be pre-filled out with the user's input. No problem there.

My issue is that if the user clicks on the Back button, i would like the information to be stored as well. SO i have one form, 1 set of input that needs to be stored in session cookies, but two buttons. One that saves the input and takes the user to the next step, and the other that saves the input and sends the user back one step.

Any ideas?

thx,
yt

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"YT" <yt******@MAPSONfunkychickens.org> wrote:
Greetings,

Just wondering if someone out there can help with this issue.

I have a questionnaire that i'm building. Each step is a separate web page with a form and a next button & back button, similar to a wizard.

What i would like to do is to make sure that all the information on the form gets retained. i'm doing this via asp & session cookies. So when the user clicks the next button, the form info is submitted and put into session cookies. if the page is redisplayed for whatever reason, the form will be pre-filled out with the user's input. No problem there.

My issue is that if the user clicks on the Back button, i would like the information to be stored as well. SO i have one form, 1 set of input that needs to be stored in session cookies, but two buttons. One that saves the input and takes the user to the next step, and the other that saves the input and sends the user back one step.

Any ideas?


Have the page to which the form submits save the data from the current
page, check which button was clicked, and then redirect to the
appropriate new page.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #2

P: n/a
"YT" <yt******@MAPSONfunkychickens.org> wrote:
I have a questionnaire that i'm building. Each step is a separate web
page with a form and a next button & back button, similar to a
wizard.
How often will users want to go back? A questionnaire is not a wizard.
Besides, what does "going back" mean here? Something else than using a
Back button?

Unless there are special reasons to provide some special "back"
functionality, I'm sure that the "back" button confuses more than helps.
What i would like to do is to make sure that all the information on
the form gets retained. i'm doing this via asp & session cookies.
Session cookies are not reliable. Besides, to make your site legal in the
EU, you would need to have a description of the use of cookies on it, and
this means extra work. (It's hard to describe the use in a manner that is
legally acceptable _and_ understandable _and_ does not make people
unnecessarily nervous.)

Using hidden fields is probably a better way. Make the script that
generates the first form generate and include a session id like
<input type="hidden" name="session" value="1389472576148">
and make further processing copy the field to new forms generated.
My issue is that if the user clicks on the Back button, i would like
the information to be stored as well.


You haven't specified what the "Back button" is, and does. And why should
the information be stored if the user wants to go _back_?

You could use different name attributes, or different value attributes,
or both, in the buttons, just as the FAQ says, in order to distinguish
between them in the form handler. But this doesn't work reliably on
current browsers if there are text input fields in the form, since
browsers may treat Enter in a text input field as a request to submit the
form _as if_ one of the buttons had been used - and browsers may differ
in interpreting which of the buttons should be simulated.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3

P: n/a
On Sun, 6 Jun 2004, Jukka K. Korpela wrote:
Session cookies are not reliable. Besides, to make your site legal in the
EU, you would need to have a description of the use of cookies on it,


A couple of commercial sites I've found so far which tried to do that,
would not allow me to read the cookie policy until after I'd accepted
a cookie. Some mistake, surely?

(Sorry, I don't have URLs - I quickly left their site and forgot
them).

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.