You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Luis Ureña <lu...@gmail.com> on 2009/06/19 22:26:42 UTC

Form survey problem (html:radio)

I am working in a survey form with several questions. Each question can have
several options. That options are builded with an iterate. When I execute
the page generate one radio button name. If I add the indexed="Yes" property
for the html:radio this generate one radio button name for all the first
option for all the questions, another radio button name for all second
options for all questions, and so on.

<tr>
    <td>
        <input type="radio" name="opcion[0].name" value="1">pangea
        <input type="radio" name="opcion[1].name" value="2">oceania
        <input type="radio" name="opcion[2].name" value="3">panthalasa
        <input type="radio" name="opcion[3].name" value="4">euroasiatico
        <input type="radio" name="opcion[4].name" value="4">De relleno
    </td>
</tr>
<tr>
    <td>
        <input type="radio" name="opcion[0].name" value="3">Arcaicas
        <input type="radio" name="opcion[1].name" value="2">Nuevas
        <input type="radio" name="opcion[2].name" value="1">Viejas
    </td>
</tr>


I need generate one radio button name for all options for the first
question. Another radio button name for all options for the second question
and son on.
(unicaBean is the bean that I put into the request. opciones bean is a
Collection into unicaBean)

This is the JSP:
<logic:iterate id="unicaBean" name="unicaBean">
    <TR id="trdark">
        <TD>
            <html:hidden name="unicaBean" property="seccion"/>
            <html:hidden name="unicaBean" property="pregunta"/>
            <bean:write name="unicaBean" property="descPregunta"/>
        </TD>
    </TR>
    <TR id="trclear">
        <TD>
            <table class="tableinfo">
                <tr>
                    <td>
                        <logic:iterate id="opcion" name="unicaBean"
property="opciones" indexId="pregunta">
                            <html:radio name="opcion" property="name"
value="id" idName="opcion" indexed="true"/>
                            <bean:write name="opcion" property="name"/>
                        </logic:iterate>
                    </td>
                </tr>
            </table>
        </TD>
    </TR>
</logic:iterate>



Somebody know how do it?

Thanks

Fwd: Form survey problem (html:radio)

Posted by Luis Ureña <lu...@gmail.com>.
I am working in a survey form with several questions. Each question can have
several options. That options are builded with an iterate. When I execute
the page generate one radio button name. If I add the indexed="Yes" property
for the html:radio this generate one radio button name for all the first
option for all the questions, another radio button name for all second
options for all questions, and so on.

<tr>
    <td>
        <input type="radio" name="opcion[0].name" value="1">pangea
        <input type="radio" name="opcion[1].name" value="2">oceania
        <input type="radio" name="opcion[2].name" value="3">panthalasa
        <input type="radio" name="opcion[3].name" value="4">euroasiatico
        <input type="radio" name="opcion[4].name" value="4">De relleno
    </td>
</tr>
<tr>
    <td>
        <input type="radio" name="opcion[0].name" value="3">Arcaicas
        <input type="radio" name="opcion[1].name" value="2">Nuevas
        <input type="radio" name="opcion[2].name" value="1">Viejas
    </td>
</tr>


I need generate one radio button name for all options for the first
question. Another radio button name for all options for the second question
and son on.
(unicaBean is the bean that I put into the request. opciones bean is a
Collection into unicaBean)

This is the JSP:
<logic:iterate id="unicaBean" name="unicaBean">
    <TR id="trdark">
        <TD>
            <html:hidden name="unicaBean" property="seccion"/>
            <html:hidden name="unicaBean" property="pregunta"/>
            <bean:write name="unicaBean" property="descPregunta"/>
        </TD>
    </TR>
    <TR id="trclear">
        <TD>
            <table class="tableinfo">
                <tr>
                    <td>
                        <logic:iterate id="opcion" name="unicaBean"
property="opciones" indexId="pregunta">
                            <html:radio name="opcion" property="name"
value="id" idName="opcion" indexed="true"/>
                            <bean:write name="opcion" property="name"/>
                        </logic:iterate>
                    </td>
                </tr>
            </table>
        </TD>
    </TR>
</logic:iterate>



Somebody know how do it?

Thanks