Connecting Tech Pros Worldwide Forums | Help | Site Map

retain value of radio button on the next page or previous page

Newbie
 
Join Date: Oct 2008
Posts: 15
#1: 3 Weeks Ago
Hi to all,

I have created a survey page that consists of 4 pages 10 question on each page. Each question are just answer using a radio button. Now my problem is i have to retain all the answer/value of radio button even the user click previous page then going back to current page. appreciate any idea please.

thank you in advance

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#2: 2 Weeks Ago

re: retain value of radio button on the next page or previous page


If you are referring to the web-browser's previous and back buttons you may have a few problems with this.

When you hit the "back button" (or previous button) a cached version of the page is displayed to you. If your page doesn't use Ajax to post information back to the server it is quite usual for these pages to retain everything selected by the user during the last full page submit to the server. (Same goes for hitting the "next" button too).

Sometimes, if you have managed to clear the user's cache (or specified that the page shouldn't be cached), or if your page uses Ajax to submit information to the server, the page will be displayed as it was originally.

If you aren't referring to the web-browsers back/next buttons...and you have links or buttons as part of your page to help with user navigation....then you can store the information in Session so that it is available to all pages.

Please explain, in more detail, what you mean by "next/previous" buttons....and explain try to explain how/why you think the information is being lost.

-Frinny
Newbie
 
Join Date: Oct 2008
Posts: 15
#3: 2 Weeks Ago

re: retain value of radio button on the next page or previous page


Yes I'am using a next/previous button. how i could use a session on this. can i have an basic example please.

thank you very much and more power.
RJ Lorenzo
omerbutt's Avatar
Needs Regular Fix
 
Join Date: Nov 2006
Location: Earth Obviously :P
Posts: 344
#4: 2 Weeks Ago

re: retain value of radio button on the next page or previous page


are you using
Expand|Select|Wrap|Line Numbers
  1.  <button type="submit" name="Next" value="Next" />
  2.  <button type="submit" name="Prev" value="Prev" />
  3.  
or the buttons on the top left side of the browser
for using session
Expand|Select|Wrap|Line Numbers
  1. Session("VariableName")=value/string
  2.  
  3.  
Reply