You are here

function pardot_admin_scoring_edit_validate in Pardot Integration 6

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

File

./pardot.admin-scoring.inc, line 122

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_result(db_query("SELECT path FROM {pardot_scoring} WHERE path = '%s' AND scoring_id <> %d", $form_state['values']['path'], $form_state['values']['scoring_id']))) {
    form_set_error('path', t('Your path much be unique'));
  }
}