This content has been marked as final.
Show 2 replies
-
1. Re: How can I disable a commandButton, depends on f: validat
ilya_shaikovsky Oct 5, 2007 10:44 AM (in response to hdmonty)I ve used
<h:form id="form"> <script> function checkMessages(){ if (document.getElementById('form:messages')==null){ document.getElementById('form:button').disabled=false; } else{ document.getElementById('form:button').disabled=true; } } </script> <h:inputText value="#{bean.property1}" required="true"> <f:validateLength minimum="3" maximum="5"/> <a4j:support event="onkeyup" bypassUpdates="true" ajaxSingle="true" oncomplete="checkMessages();"/> </h:inputText> <a4j:outputPanel ajaxRendered="true"> <h:messages id="messages"/> </a4j:outputPanel> <a4j:commandButton value="Press me!" id="button"/> </h:form>
For such functionality.. Unfortunatelly I'm failed to use rich:messages - because to be ajax updatable they always generate span with messages id :// -
2. Re: How can I disable a commandButton, depends on f: validat
hdmonty Oct 5, 2007 11:12 AM (in response to hdmonty)Thank you very much, it works fine.