struts-javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • albies
    New Member
    • Nov 2008
    • 1

    struts-javascript

    Ciao a tutti, sono nuovo. Ho il problema di recuperare dei campi di struts che si trovano in un iterate indicizzati in una function javascript.

    questo è il codice del mio iterate:

    -------------------------------------------------------------------------------------
    Code:
    <% int i = 0; %>
    <logic:iterate id = "distribuzione" name = "PolivalenzaPdlcPersoneForm"         property="listaPlde" type="hse.tpi.vo.PdlcPdlePolivalenzeVO" indexId="ctr">
     <tr>
           <td style="display:none;">
    	<bean:write name = "distribuzione" property="distPolivalenzeId" />
    	</td>
    	<input type="hidden" name="distribuzione" property="distPolivalenzeId" indexed="true">
    	<td style="display:none;">
    	<bean:write name = "distribuzione" property="posizElemId" />
    	</td>
    	<input type="hidden" name="distribuzione" property="posizElemId" indexed="true">
    	<td style="display:none;">
    	<bean:write name = "distribuzione" property="personaId" />
    	</td>
    	<input type="hidden" name="distribuzione" property="personaId" indexed="true">
    	<td>
    	<bean:write name = "distribuzione" property="posizElemCod" />
    	</td>
    	<input type="hidden" name="distribuzione" property="posizElemCod" indexed="true">
    	<td>
    	<bean:write name = "distribuzione" property="posizElemDesc" />
    	</td>
    	<input type="hidden" name="distribuzione" property="posizElemDesc" indexed="true">
    	<td>
    	<bean:write name = "distribuzione" property="dataInizio" />
    	</td>
    	<input type="hidden" name="distribuzione" property="dataInizio" indexed="true">
    	<td>
    	<bean:write name = "distribuzione" property="dataFine" />
    	</td>
    	<input type="hidden" name="distribuzione" property="dataFine" indexed="true">
    	<logic:equal name="distribuzione" property="stato" value="C">
    	<td>
    		<bean:write name = "distribuzione" property="frequenzaPercPdle" />
    	</td>					
    	<input type="hidden" name="distribuzione" property="frequenzaPercPdle" indexed="true">
    	</logic:equal>
    	<logic:equal name="distribuzione" property="stato" value="A">
    		<td >
    	        <html:text name = "distribuzione" property="frequenzaPercPdle" maxlength="3" style=" text-align: right;" indexed="true"/>
    		</td>
    	</logic:equal>
    	 </tr>
    	  <% i++; %>
           </logic:iterate>
    -------------------------------------------------------------------------------------


    la mia function javascript è la seguente:

    --------------------------------------------------------------
    Code:
    function confermaPolivalenza(count,form){	
    
    	for(var x=0;x<count;x++){  	
    	    alert("frequenza="+(form.elements["distribuzione["+x+"].frequenzaPercPdle"]).value);
    	}	
    
    }
    ------------------------------------------------------------

    vorrei soltanto capire come si riesce a prendere il valore all'indice 'x' dei miei campi property...

    grazie
    Last edited by acoder; Nov 4 '08, 05:49 PM. Reason: Added [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This is an English language forum. Please translate your post into English. See generally unacceptable things. Thanks.

    Comment

    Working...