• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to keep selected radio button after page refresh

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a radio button group with 3 radio buttons, when I select a particular radio button each one of them will transfer the control to another jsp page, performs some calculations and returns to the caller jsp page, but when I return my radio button is not checked. How can i keep it selected.

I tried taking the value of the radio button in a string in the jsp page where I am doing some calculations and again setting the radio button value in a hidden field, when I return to the caller jsp page I am trying to write jsp code in the radio button value property as:





where hiddenfiled is the hidden field name in the other jsp page.

How can i keep my radio button selected even after page refresh. Please guide me.
[ August 11, 2006: Message edited by: Sree Mami ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would have to set th value with cookies and than check the cookie onload to see if it needs to be selected.

Eric
 
Sree Mami
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric

Can you post me a sample code for that?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're doing this with JSP, there's no need for cookies, the value of the request param is still available when the JSP is being processed and you should be able to use it to set the "checked" attribute.

I've moved this to the JSP forum for any further discussion.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

when I select a particular radio button each one of them will transfer the control to another jsp page, performs some calculations and returns to the caller jsp page,



Your language is very imprecise here. How are the transitions from resource to resource being made? forwards? redirects?

Without these details, it will be difficult to help you out.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic