0 Replies Latest reply on Apr 9, 2009 11:49 AM by kretes

    client side validation with form submitting disabled and enabled

    kretes
      I appreciate the way hibernate validator + rich faces tag support reRender="" works, because it gives user fast feedback about correctness of data.

      I wanted to disable form submitting when there exist validation errors, and user sees them, so i took this solution:


        <h:inputTextarea value="#{leaveHome.instance.requestorComment}" required="true">
         <a4j:support event="onblur" reRender="commentField,save" bypassUpdates="true" />
        </h:inputTextarea>

      [..]

      <h:commandButton id="save"
                                value="Save"
                               action="#{leaveHome.persist}"
                             rendered="#{!leaveHome.managed}"
                             disabled="#{!validation.succeeded}"/>

      I tried also

                 disabled="#{validation.failed}"/>

      but the 'save' button, once disabled, never gets enabled again, after validation errors are fixed...

      I want it to enable when user fixes input errors