You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by elan <eh...@yahoo.com> on 2007/05/11 01:03:23 UTC

Re: dynamic checkboxes and radio buttons in one group

I am trying to figure out the same thing but using Struts. I have the
following jsp to display my questions.

  <s:form action="Quiz">
      <s:iterator value="questions">
        <s:radio label="${text}" name="${id}" list="answers"/>
      </s:iterator>
      <s:submit key="Save Me" method="save" />
  </s:form>

For example this will display 2 questions and each question has a set of
answers with radio buttons. On submit how do I capture which radio buttons
were selected since the radio name field is dynamic?

-- 
View this message in context: http://www.nabble.com/dynamic-checkboxes-and-radio-buttons-in-one-group-tf1971631.html#a10423148
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: dynamic checkboxes and radio buttons in one group

Posted by elan <eh...@yahoo.com>.
I left out of the original post that I am using Struts 2.

-- 
View this message in context: http://www.nabble.com/dynamic-checkboxes-and-radio-buttons-in-one-group-tf1971631.html#a10423856
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: dynamic checkboxes and radio buttons in one group

Posted by elan <eh...@yahoo.com>.
well, the number of questions and set of answers for each are dynamic
(determined at runtime). I could look at the response object but hopefully
there is a cleaner way of implementating this.


Dave Newton-4 wrote:
> 
> --- elan <eh...@yahoo.com> wrote:
>> On submit how do I capture which radio buttons
>> were selected since the radio name field is dynamic?
> 
> Don't make the whole name dynamic; use a map (or
> something similar).
> 
> d.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/dynamic-checkboxes-and-radio-buttons-in-one-group-tf1971631.html#a10423843
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: dynamic checkboxes and radio buttons in one group

Posted by Dave Newton <ne...@yahoo.com>.
--- elan <eh...@yahoo.com> wrote:
> On submit how do I capture which radio buttons
> were selected since the radio name field is dynamic?

Don't make the whole name dynamic; use a map (or
something similar).

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org