0 Replies Latest reply on Sep 10, 2012 12:00 AM by tungtrum17

    help I validate form problems using <a4j:commandButton>

    tungtrum17

      Hi All...

      I have code jquery :

       

      $j(".buttonsave").live("click",function(){

                  if($j('.requiredF').val() == ''){

                      alert("Error");

                  }                      

             });

       

      I using :

       

      <h:inputText value="#{customerExpand.NV102}" id="firstname" styleClass="requiredF">

      </h:inputText>

       

       

      <a4j:commandButton  value='#{locale.save}' actionListener="#{customerExpand.saveN100andN590}"

                                                          onclick="showPleaseWait();"

                                                          oncomplete="hidePleaseWait();"

                                                          styleClass="buttonsave" reRender="message1,contact" >

                                        

      </a4j:commandButton>

       

      When input = null ---> code run ok but it still runs on the action although the error.I added ajaxSingle ="true" to the problem to be addressed is not at fault action.But when no error occurs, the a4j: commandButton is not in action.

       

      Thanks All