0
我有一個表單來更新用戶的信息,如果驗證失敗,它會顯示錯誤消息,並在糾正錯誤輸入後,表單不會提交爲什麼?沒有錯誤信息,它提交得很好。爲什麼表單在驗證錯誤消息後未被提交?
<h:form id="update" prependId="false">
<h:outputText value="Name: " styleClass="titleBlue"/>
<h:inputText id="contactName" value="#{serviceBean.contactName}" maxlength="50" size="15" style="width:200px" >
<f:validateLength minimum="3" maximum="50"/>
</h:inputText>
<h:message for="contactName" style="color:red;font-size: 0.70em;"/>
<h:outputText value="Title: " styleClass="titleBlue"/>
<h:inputText id="contactTitle" value="#{serviceBean.contactTitle}" maxlength="50" size="15" style="width:200px">
<f:validateLength minimum="3" maximum="50"/>
</h:inputText>
<h:message for="contactTitle" style="color:red;font-size: 0.70em;"/>
<h:panelGroup style="display:block; text-align:center">
<a4j:commandButton action="#{serviceBean.update}" styleClass="titleBold" value="Update"/>
</h:panelGroup>
</h:form>
如果輸入(導致驗證錯誤)被糾正,表單是否正確提交? – 2011-04-18 15:11:29
表單在輸入更正後不會提交 – gkp 2011-04-18 15:14:08
這不是說它應該如何工作?如果失敗,請不要提交... – Niklas 2011-04-18 15:14:08