You are here

function tracking_code_overview_form_validate in Tracking Code 7

Validation function for tracking_code overview/weight table.

File

./tracking_code.admin.inc, line 388
admin page callbacks and form handlers for the tracking code module

Code

function tracking_code_overview_form_validate($form, $form_state) {
  foreach ($form_state['values'] as $key => $value) {
    if (preg_match('/^weight_[0-9]+$/', $key)) {
      if (!is_numeric($value)) {
        form_set_error($key, t('Weight attribute must be a numeric value.'));
      }
    }
  }
}