assets/js/script.js
/**
     * @desc Check if all elements pass validation
     * @param {object} elements - object of items for validation
     * @param {object} captcha - captcha object for validation
     * @return {boolean}
     */
@desc Check if all elements pass validation
@param {object} elements - object of items for validation
@param {object} captcha - captcha object for validation
@return {boolean}
@desc Check if all elements pass validation @param { object } elements - object of items for validation @param { object } captcha - captcha object for validation @return { boolean }
function isValidated(elements, captcha) {
      var results,
        errors = 0;
      if (elements.length) {
        for (var j = 0; j < elements.length; j++) {
          var $input = $(elements[j]);
          if ((results = $input.regula("validate")).length) {
            for (k = 0; k < results.length; k++) {
              errors++;
              $input
                .siblings(".form-validation")
                .text(results[k].message)
                .parent()
                .addClass("has-error");
            }
          } else {
            $input
              .siblings(".form-validation")
              .text("")
              .parent()
              .removeClass("has-error");
          }
        }
        if (captcha) {
          if (captcha.length) {
            return validateReCaptcha(captcha) && errors === 0;
          }
        }
        return errors === 0;
      }
      return true;
    }
function isValidated ( elements , captcha ) { var results , errors = 0 ; if ( elements . length ) { for ( var j = 0 ; j < elements . length ; j ++ ) { var $input = $ ( elements [ j ] ) ; if ( ( results = $input . regula ( "validate" ) ) . length ) { for ( k = 0 ; k < results . length ; k ++ ) { errors ++ ; $input . siblings ( ".form-validation" ) . text ( results [ k ] . message ) . parent ( ) . addClass ( "has-error" ) ; } } else { $input . siblings ( ".form-validation" ) . text ( "" ) . parent ( ) . removeClass ( "has-error" ) ; } } if ( captcha ) { if ( captcha . length ) { return validateReCaptcha ( captcha ) && errors === 0 ; } } return errors === 0 ; } return true ; }
@desc Check if all elements pass validation
 @param {object} elements - object of items for validation
 @param {object} captcha - captcha object for validation
 @return {boolean}
@desc Check if all elements pass validation @param { object } elements - object of items for validation @param { object } captcha - captcha object for validation @return { boolean }