2011-04-18 32 views
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> 
+0

如果輸入(導致驗證錯誤)被糾正,表單是否正確提交? – 2011-04-18 15:11:29

+0

表單在輸入更正後不會提交 – gkp 2011-04-18 15:14:08

+0

這不是說它應該如何工作?如果失敗,請不要提交... – Niklas 2011-04-18 15:14:08

回答

0

爲什麼形式沒有得到提交顯示警告信息後: 我需要的id如果該值是空集的默認值,並提交表單。

+0

該值不爲空 – gkp 2011-04-19 07:59:24

相關問題