2
1
0

Is there a function to check whether a form is valid without firing the validation/mandatory rules?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Yulius,

      You can run the validateBlock function on each of the Section Level 1 blocks, with the getResultsOnly parameter set to true blocks to achieve this:

      // Add each section block to this array
      var sections = [{Section1},{Section2}];
      var isValid = true;
       
      // Check if any of the blocks contain invalid data
      for(var i = 0; i < sections.length; i++){
          if(!sfc.validateBlock(sections[i], true)){
              isValid = false;
              break;
          }
      }
      
      //Do something with isValid result
      ...

      Cheers,

      Jye

        CommentAdd your comment...