You are here

function pardot_admin_scoring_edit_validate in Pardot Integration 7

Same name and namespace in other branches
  1. 6 pardot.admin-scoring.inc \pardot_admin_scoring_edit_validate()
  2. 7.2 pardot.admin-scoring.inc \pardot_admin_scoring_edit_validate()

Form validation handler for pardot_admin_scoring_edit().

See also

pardot_admin_scoring_edit_submit()

File

./pardot.admin-scoring.inc, line 161
Admin scoring form.

Code

function pardot_admin_scoring_edit_validate($form, $form_state) {
  if (!is_numeric($form_state['values']['score'])) {
    form_set_error('score', t('Your score must be a number'));
  }
  if (db_query("SELECT path FROM {pardot_scoring} WHERE path = :path AND scoring_id <> :scoring_id", array(
    ':path' => $form_state['values']['path'],
    ':scoring_id' => $form_state['values']['scoring_id'],
  ))
    ->fetchField()) {
    form_set_error('path', t('Your path much be unique'));
  }
}