[struts]Form con 2 submit

di il
1 risposte

[struts]Form con 2 submit

Salve a tutti ho questo piccolo problema..vorrei creare un form con due submit ognuno dei quali mi genera un dispatch diverso:

<SCRIPT language="JavaScript">
function dispatch()
{
switch(document.pressed.value){
case "Inserisci":
document.scelta.action="/ricercaAction.do?dispatch=Inserisci";
break;
case "Ricerca":
document.scelta.action="/ricercaAction.do?dispatch=Ricerca";
break;
case "All":
document.scelta.action="/ricercaAction.do?dispatch=All";
break;
}

return true;
}
</SCRIPT>

<html:form name="scelta" onsubmit="return dispatch(); ">
<input type="hidden" name="pressed" value="" />

<th scope="col">CAMPI</th>
<th scope="col">INPUT</th>
</tr>
<tr>
<td class="leftCell">Nome:</td>
<td class="rightCell"><html:text property="nome"></html:text></td>
</tr>
<tr>
<td class="leftCell">Cognome:</td>
<td class="rightCell"><html:text property="cognome"></html:text></td>
</tr>
<tr>
<td class="leftCell">Email:</td>
<td class="rightCell"><html:text property="email"></html:text></td>
</tr>
<tr>

<td class="rightCell"><html:submit onclick="document.pressed.value='Ricerca'" value="Cerca" /></td>
<td class="rightCell"><html:submit onclick="document.pressed.value='Inserisci'" value="Inserisci" />
<html:submit onclick="document.pressed.value='All'" value="All" /></td>
</tr>
</table>
</html:form>


ma mi da sempre ques'errore:Attribute name invalid for tag form according to TLD

Sapete aiutarmi?non capisco dove sbaglio!!

1 Risposte

  • Re: [struts]Form con 2 submit

    Ti sei dimenticato la proprieta action nel tag form. Infatti è required. Quarta il tld

    <tag>
    <name>form</name>
    <tagclass>org.apache.struts.taglib.html.FormTag</tagclass>
    <bodycontent>JSP</bodycontent>
    -
    <attribute>
    <name>action</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>acceptCharset</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>disabled</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>enctype</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>focus</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>focusIndex</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>method</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>onreset</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>onsubmit</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>readonly</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>scriptLanguage</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>style</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>styleClass</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>styleId</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    -
    <attribute>
    <name>target</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
Devi accedere o registrarti per scrivere nel forum
1 risposte