function search_autocomplete_form_configure_validate in Search Autocomplete 6.4
Same name and namespace in other branches
- 7.4 search_autocomplete.form.configure.inc \search_autocomplete_form_configure_validate()
- 7.3 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 203 - Search Autocomplete Helper functions to retrive forms 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']);
$item = array(
'link_path' => $new_url,
);
if (!menu_valid_path($item)) {
form_set_error('url', t('callback url is not valid: @new_url', array(
'@new_url' => $new_url,
)));
}
}
}