original_string: function getValidationScript($format = null) {
          global $CFG;
          if (!empty($CFG->strictformsrequired)) {
              if (!empty($format) && $format == FORMAT_HTML) {
                  return array('', "{jsVar}.replace(/(<(?!img|hr|canvas)[^>]*>)|&nbsp;|\s+/ig, '') == ''");
              } else {
                  return array('', "{jsVar}.replace(/^\s+$/g, '') == ''");
              }
          } else {
              return array('', "{jsVar} == ''");
          }
      }
code: function getValidationScript($format = null) {
          global $CFG;
          if (!empty($CFG->strictformsrequired)) {
              if (!empty($format) && $format == FORMAT_HTML) {
                  return array('', "{jsVar}.replace(/(<(?!img|hr|canvas)[^>]*>)|&nbsp;|\s+/ig, '') == ''");
              } else {
                  return array('', "{jsVar}.replace(/^\s+$/g, '') == ''");
              }
          } else {
              return array('', "{jsVar} == ''");
          }
      }
code_tokens: function getValidationScript ( $ format = null ) { global $ CFG ; if ( ! empty ( $ CFG -> strictformsrequired ) ) { if ( ! empty ( $ format ) && $ format == FORMAT_HTML ) { return array ( '' , "{jsVar}.replace(/(<(?!img|hr|canvas)[^>]*>)|&nbsp;|\s+/ig, '') == ''" ) ; } else { return array ( '' , "{jsVar}.replace(/^\s+$/g, '') == ''" ) ; } } else { return array ( '' , "{jsVar} == ''" ) ; } }
docstring: This function returns Javascript code used to build client-side validation.
  It checks if an element is not empty.
  
  @param int $format format of data which needs to be validated.
  @return array
docstring_tokens: This function returns Javascript code used to build client - side validation . It checks if an element is not empty .