Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Keeping Radio selection

 
Dan Parsons
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I keep Radio button value and not lose it after a Form is submitted?
I have no problem keeping text values where a form is submitted and if
there is a validation issue with the text value it takes me back to the Form and shows the Form text value that was submitted.
With Radio buttons it clears the Radio selection.
Please advise.

JavaBean:




Form in JSP:

[ October 30, 2007: Message edited by: Dan Parsons ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following code:



What is it exactly that you are expecting the <jsp:getProperty> to do for you? Have you checked what the HTML ends up looking like? Is it valid?
 
Dan Parsons
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTML source shows the Radio is not checked on all my attempts.
I want the getProperty to return the value of what was checked and
I assume it wont do that with Radio and I will need to create a Bean method to do it?

Is this the right direction?






Please advise because I dont have Struts in my environment.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, check the HTML being sent to the browser to make sure that it is valid. Is the HTML correctly formatted to cause the radio button to be checked?
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!