You are here

function clientside_validation_add_xregexp in Clientside Validation 6

Same name and namespace in other branches
  1. 7.2 clientside_validation.module \clientside_validation_add_xregexp()
  2. 7 clientside_validation.module \clientside_validation_add_xregexp()
1 call to clientside_validation_add_xregexp()
_clientside_validation_add_general_settings in ./clientside_validation.module

File

./clientside_validation.module, line 334
Add client side validation to a webform.

Code

function clientside_validation_add_xregexp() {
  $variant = variable_get('clientside_validation_xregxp_variant', '');
  $lib = FALSE;
  if (empty($variant)) {
    $lib = xregexp_api_libraries_load('xregexp');
  }
  else {
    $lib = xregexp_api_libraries_load('xregexp', $variant);
  }
  return $lib && (!isset($lib['error']) || !$lib['error']) ? 1 : 0;
}