You are here

function search_autocomplete_form_configure_validate in Search Autocomplete 7.3

Same name and namespace in other branches
  1. 6.4 search_autocomplete.form.configure.inc \search_autocomplete_form_configure_validate()
  2. 7.4 search_autocomplete.form.configure.inc \search_autocomplete_form_configure_validate()

Implements hook_validate(). Save the changes in the database

File

./search_autocomplete.form.configure.inc, line 189
Search Autocomplete Helper functions to retrive suggestions from database

Code

function search_autocomplete_form_configure_validate($form, &$form_state) {
  $values = $form_state['values'];
  if ($values['suggestions'] == 1) {
    $new_url = preg_replace('/\\?[^=]*=[^&]*/', '', $values['callback_textfield']);
    if (!drupal_valid_path($new_url)) {
      form_set_error('url', 'callback url is not valid: ' . $new_url);
    }
  }
}