2 Replies Latest reply on Jan 7, 2008 2:06 PM by Florian Marwede

    JS error in a4j code

    Florian Marwede Expert

      In the following code fragment I get sometimes a js error in the marked line. I can't reproduce when exactly it occurs...

      A4J.AJAX.SubmitRequest = function( containerId, formId ,domEvt , options ) {
       // First - run onsubmit event for client-side validation.
       LOG.debug("NEW AJAX REQUEST !!! with form :"+formId );
      // var form = A4J.AJAX.locateForm(event);
       var form = window.document.getElementById(formId);
       if( (!form || form.nodeName.toUpperCase() != "FORM") && domEvt ) {
       var srcElement = domEvt.target||domEvt.srcElement||null;
       if(srcElement){
       form = A4J.AJAX.locateForm(srcElement);
       };
       };
       // TODO - test for null of form object
      ***>>> if(!options.submitByForm && form && form.onsubmit) {
       LOG.debug("Form have onsubmit function, call it" );
       if( form.onsubmit() == false ){
       return false;
       };
       };


      I noticed the given debug line but I'm not sure if it's a TODO for me or a Rich Faces developer (?)