5 Replies Latest reply on Sep 29, 2008 9:24 AM by Ilya Shaikovsky

    <a4j:commandButton> request isn't fired when validate javasc

    Khilesh Prasad Newbie

      Hello everybody,
      Any one help me why <a4j:commandButton> request isn't fired when validate some field using javascrip.

      <script>
      function validate(){
      var txtId = document.getElementById('form:Txt');
      if(txtId.value==' ')
       return false;
      else
       return true;
      
      }
      
      </script>
      
      <h:form id="form">
      <h:inputText id="Txt" value="#{bean.name}"/>
      <a4j:commandButton value="Ok" action="#{bean.action()}" reRender="form" onclick="return validate();"/>
      </h:form>
      


      I am able to validate the input field it is working , but when i click on 'Ok ' Button the request isn't fired on action class.
      Plaese help me how to do this ..help me how to manage both validation and action i am using richfaces 3.2.1......
      Thanks