You are here

function _clientside_validation_set_dategroup_required in Clientside Validation 6

Set validation rule for dates

1 call to _clientside_validation_set_dategroup_required()
clientside_validation_cck in clientside_validation_form/clientside_validation_form.module

File

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

Code

function _clientside_validation_set_dategroup_required($name, $title, $id, &$js_rules, $min = 1, $max = 99) {
  $title = variable_get('clientside_validation_prefix', '') . $title . variable_get('clientside_validation_suffix', '');
  $js_rules[$name]['dategrouprequired'] = array(
    $min,
    $max,
    $id,
  );
  $variables = array(
    'message' => '!title field is required.',
    'placeholders' => array(
      '!title' => $title,
    ),
    'error_type' => 'required',
    'element_name' => $name,
  );
  $js_rules[$name]['messages']['dategrouprequired'] = theme('clientside_error', $variables);
}