5 Replies Latest reply on Apr 26, 2007 11:25 PM by Sergey Smirnov

    a4j:commandButton problem

    loren yang Newbie

       

      <a4j:commandButton id="btnSaveData" value="#{bundle.savedata}" onclick="return btnSaveDataClick();"
       actionListener="#{richfacesFormBean.saveData}" reRender="promptInfo"/>
      
      function btnSaveDataClick() {
       var usname = document.forms[0]['form1:userName'].value;
       var paword = document.forms[0]['form1:passWord'].value;
       if(usname=='' || paword=='') {
       return false;
       }
      }
      


      Whether the js function return true or false, a4j:commandButton doesn't do
      submit, and if I remove the onclick="return btnSaveDataClick();", the a4j:commandButton work well! Any ideas? TIA.