Form analysis

Integrate NV javascript code to analyze forms.

Events

When a form is successfully submitted, use the following code :

if(nv){    
    nv('form_submit',  'success');     
}

When a form fails validation, use the following code :

if(nv){       
    nv('form_submit',  'fail');    
}

Usage Example

Let's assume that this is the function, that handles your form's submissions:

$('#exampleForm').submit(function(event) {     
           'use strict';  
           event.preventDefault();  

          /** .. Validation code here.. **/    
      
           if (valid) {
  
          /** Validation passed - continue... **/  
 
          }  else {  
           
          /** Validation not passed - halt **/   
 
          }  
    
          return false;     
});

The Form Submission Events need to be placed in the following order:

$('#exampleForm').submit(function(event) {   
          'use strict';            
          event.preventDefault();     
             
        /** .. Validation code here.. **/  

       
        if (valid) {  
                
        /** Validation passed - continue... **/              
        if(nv){ 
            nv('form_submit', 'success');      
           }  
          
        } else {
                      
         /** Validation not passed - halt **/        
         if(nv){ 
           nv('form_submit', 'fail');  
             
          }  
       
       } 
      
          return false;
      });