Ciao a tutti, ho una pagina jsp e al submit ho un errore javascript
Ecco un frammento della pagina:
Ecco la funzione javascript confermaMediazioneMod()codice:<html> <form name="myForm" action="myAction"> <TABLE border="0" bgcolor="#bed3df" > <TR> <TD></TD> <TD>Data inserimento mediazione:</TD> <TD></TD> <TD> <% java.text.SimpleDateFormat sdfDtStd = new java.text.SimpleDateFormat("dd/MM/yyyy"); %> <%=sdfDtStd.format(new java.util.Date())%> </TD> <TD></TD> <TD><Font color="red">*</Font></TD> <TD>Data Ricezione Mediazione:</TD> <TD></TD> <td> <% String dtricezioneDisabled="disabled=\"disabled\""; if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ dtricezioneDisabled=""; } %> <INPUT type="text" id="dtoper" name="dtoper" value="<%=valoredtoper%>" dojoType="dijit.form.DateTextBox" constraints="{datePattern: 'dd/MM/yyyy'}" <%=dtricezioneDisabled%> /> </TD> <TD></TD> </TR> <TR> <TD></TD> <TD>Ufficio Liquidativo:</TD> <TD></TD> <TD> <%= ufficioLiquidativo %> </TD> <TD></TD> </TR> <TR> <TD></TD> <TD>Denominazione controparte:</TD> <TD></TD> <TD> <%=denctp%> </TD> <TD></TD> </TR> <tr> <TD><Font color="red">*</Font></TD> <TD>Tipo Mediazione:</TD> <TD></TD> <td> <% String tipoDisabled="disabled=\"disabled\""; if(causaMed!=null){ String tipoValue=causaMed.getFgatpas(); } if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ tipoDisabled=""; } else { %> <input type="hidden" name="fgatpas" value="<%=tipoValue%>"/> <% } %> <select dojoType="dijit.form.FilteringSelect" autocomplete="true" id="fgatpasID" name="fgatpas" <%=tipoDisabled %> value="<%=tipoValue%>"> <option value="" selected="selected"></option> <option value="A" >Attiva</option> <option value="P" >Passiva</option> </select> </td> <td></td> <TD><Font color="red">*</Font></TD> <TD>Oggetto:</TD> <TD></TD> <td> <% String oggettoDisabled="disabled=\"disabled\""; if(causaMed!=null) String oggettoValue=causaMed.getOggcau(); if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ oggettoDisabled=""; } else{ %> <input type="hidden" name="oggCau" value="<%=oggettoValue%>"/> <% } %> <INPUT dojoType="dijit.form.FilteringSelect" pageSize="15" store="oggCauStore" autoComplete="true" mode="local" id="oggCauID" name="oggCau" style='width:400px;' <%=oggettoDisabled %> value="<%=oggettoValue%>"/> </td> <td></td> </tr> <tr> </TR> <TR> <TD><Font color="red">*</Font></TD> <TD>Data Incontro:</TD> <TD></TD> <TD> <% String dtincontroDisabled="disabled=\"disabled\""; if(causaMed!=null){ String valoreDataIncontro=Formatta.getDataFormattata(causaMed.getDtCitAss(), "yyyy-MM-dd"); } if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ dtincontroDisabled=""; } else{ %> <input type="hidden" name="dtincontro" value="<%=valoreDataIncontro%>"/> <% } %> <INPUT type="text" id="dtincontro" name="dtincontro" value="<%=valoreDataIncontro%>" dojoType="dijit.form.DateTextBox" constraints="{datePattern: 'dd/MM/yyyy'}" <%=dtincontroDisabled%> /> </TD> <TD></TD> </TR> <tr> <TD><Font color="red">*</Font></TD> <TD>Sede Mediazione:</TD> <TD></TD> <TD> <% if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ %> <INPUT type="text" name="foro" value="<%=sedeMediazione!=null&&!sedeMediazione.equals("")?sedeMediazione:foro%>" size="25" maxlength="50" onfocus="javascript: blur();"> <INPUT type="button" name="sceltaForo" value="Seleziona" onclick="javascript: scegliForo();"> <% } else { if (!showCausa) { %> <INPUT type="hidden" name="foro" value="<%=(causaMed != null && causaMed.getForo()!=null)?causaMed.getForo():""%>"> <% } %> <%=(causaMed != null && causaMed.getForo()!=null)?causaMed.getForo():""%> <% } %> </TD> <TD></TD> <TD><Font color="red">*</Font></TD> <TD>Organismo di Mediazione:</TD> <TD></TD> <td> <% String odmDisabled="disabled=\"disabled\""; if(causaMed!=null) String odmValue=causaMed.getCentemed(); if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ odmDisabled=""; } else{ %> <input type="hidden" name="odm" value="<%=odmValue%>"/> <% } %> <INPUT dojoType="dijit.form.FilteringSelect" pageSize="15" store="odmStore" autoComplete="true" mode="local" id="odmID" name="odm" style='width:400px;' value="<%=odmValue%>" <%=odmDisabled %>/> </td> <TD></TD> </TR> <TR> <TD><Font color="red">*</Font></TD> <TD>Accordo ANIA:</TD> <TD></TD> <TD> <% String accANIADisabled="disabled=\"disabled\""; if(causaMed!=null) String accANIAValue=causaMed.getAccordoAnia(); if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ accANIADisabled=""; } else{ %> <input type="hidden" name="accAnia" value="<%=accANIAValue%>"/> <% } %> <INPUT dojoType="dijit.form.FilteringSelect" pageSize="15" store="accordoANIAStore" autoComplete="true" mode="local" id="accAniaID" name="accAnia" style='width:400px;' value="<%=accANIAValue%>" <%=accANIADisabled %>/> </TD> <TD></TD> </TR> <TR> <tr> <TD><Font color="red">*</Font></TD> <TD>Adesione:</TD> <TD></TD> <td> <% String adesioneDisabled="disabled=\"disabled\""; if(causaMed!=null){ String adesioneValue=showEsitoMediaz?adesioneValue: causaMed.getAdesione(); } if(modifiableMediazioneFields&&!"esitoMediaz".equals(richiesta)){ adesioneDisabled=""; } else{ %> <input type="hidden" name="ades" value="<%=adesioneValue%>"/> <% } %> <select dojoType="dijit.form.FilteringSelect" pageSize="15" autoComplete="true" mode="local" id="adesID" name="ades" style='width:400px;' value="<%=adesioneValue%>" <%=adesioneDisabled %>> <option value=" " selected="selected"></option> <option value="S" >Si</option> <option value="N" >No</option> </select> </td> <td></td> <TD></TD> <TD> <% String disabled=""; if(causaMed!=null) String motivazValue=causaMed.getMotch(); String styleDivMotch="style='visibility:hidden;'"; if(adesioneValue!=null&&adesioneValue.equalsIgnoreCase("N")){ styleDivMotch=""; disabled="disabled=\"disabled\""; } %> <div id="motchLabelDiv" <%=styleDivMotch %>> Motivazione: </div> </TD> <TD></TD> <TD> <input type="hidden" name="motch" value="<%=motivazValue%>"/> <div id="motchDiv" <%=styleDivMotch %>> <INPUT dojoType="dijit.form.FilteringSelect" pageSize="15" store="motivazioniStore" autoComplete="true" mode="local" id="motchID" name="motch1" value="<%=motivazValue %>" style='width:400px;' <%=disabled %> /> </div> <TD></TD> </TR> <TR> <TD colspan="10" align="center"></TD> </tr> <TR> <TD id ="pt8" align="center" colspan="3"> <INPUT TYPE="button" NAME="updateButt" VALUE=" Save " id="pt8" onClick="confermaMediazioneMod();"> </TD> </tr> <table> </form> </html>
codice:function confermaMediazioneMod(){ if(controlloDatiChiusuraMediazione()) { document.body.style.cursor = "wait"; document.frmCausa.richiesta.value="med"; document.frmCausa.submit(); } }
dove la funzione controlloDatiChiusuraMediazione() è la seguente(dove ho messo degli alert di esempio)
Nel submit, chiamato dalla funzione confermaMediazioneMod() dal bottone Save(il name è updateButt) ho il seguente errore con Firefoxcodice:function controlloDatiChiusuraMediazione() { if(dijit.byId('dtoper').value == ""){ alert("alert1"); return false; } if(dijit.byId('fgatpasID').value==''){ alert('alert2'); return false; } if(dijit.byId('oggCauID').value==''){ alert('alert3'); return false; } if(dijit.byId('dtincontro').value == ""){ alert("alert4"); return false; } if(document.frmCausa.foro.value == ""){ alert("alert5"); return false; } if(dijit.byId('odmID').value == ""){ alert("alert6"); return false; } if(dijit.byId('accAniaID').value == ""){ alert("alert7"); return false; } if(dijit.byId('adesID').value=='N'){ if(document.frmCausa.motch.value == " "||document.frmCausa.motch.value == ""){ alert("alert8"); return false; } } else if(dijit.byId('adesID').value==''){ alert("alert9"); return false; } return true; }
nel debug con Firebug e il sistema non consente di andare avanticodice:document.myForm.submit is not a function
Qualcuno può aiutarmi?
Grazie![]()

Rispondi quotando