Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struts Radio tag

Status
Not open for further replies.

epiuse

Programmer
Aug 13, 2003
1
US
Hi,

I have run into a problem while using struts radio buttons. I have a property "newAttribute" which is an array of strings in which i collect all the different variables' values that the user enters. The problem comes when i have more than one radio buttons. Then, since the name is the same for all the radio buttons, they all behave like one button.

So i am looking for a way to separate the name of the radio button from the property. is there anyway i can do that??

thanx
 
Hi epiuse,

To have more radio buttons means to give the user the choose between different options of the same property¨. Are you sure you don´t need checkboxes for your stuff?
What you could do with the radio buttons would be someting like (just HTML snippet):
---
<input type=radio¨ name=¨newAttribute¨ value=¨first¨>
<input type=radio¨ name=¨newAttribute¨ value=¨second¨>
<input type=radio¨ name=¨newAttribute¨ value=¨third¨>
----
and when the user POST or GET the data you´&#314;l receive the value of the checked radio button as value for ¨newAttribute¨.

HTH,
Cezar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top