• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help with Radio Button in Struts 2

 
JackKumar Kumari
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Java. I would really appreciate if someone could help me with the radio button.

I need to have a radio button, and if the user selects one of them some text should come up. Do not know the syntax for if statement. I have the code below:

<s:radio name="first" list="{'Yes','No'}" value ="%{'Yes'}"/>
<s:if test ="%{#first == 'Yes'}">
<div><testing></div>
</s:if>

Please help. Thanks in Advance.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're trying to dynamically change the page then you need to use JavaScript--tags are evaluated on the *server* side.
 
JackKumar Kumari
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry to bother you with the question again.

Just for may understanding you mean that I will have to use Javascript if I want to have the ability for the user to change the radio buttons on the web and display data accordingly(depending on the selection by the user I dispaly the set of questions).

Thanks in advance

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to change page contents without a form submit/page refresh then you'll need to use JavaScript and/or Ajax.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic