Skip to content

Instantly share code, notes, and snippets.

@wluisi
Created June 28, 2016 01:42
Show Gist options
  • Save wluisi/0e9681e2437444c4c6f979b98687eaa6 to your computer and use it in GitHub Desktop.
Save wluisi/0e9681e2437444c4c6f979b98687eaa6 to your computer and use it in GitHub Desktop.
rw inline error search form
<?php
// admin/config/user-interface/ife
// Set search form to 'enabled' and "remove all messages".
// LZ filter validation
$lz_filter_raw = $form_state['values']['lz_filter'];
preg_match_all('!\d+!', $lz_filter_raw, $zipcode);
$zipcode = $zipcode[0][0];
// Check if zip code is in RW database
$lz_filter = rrd_search_validate_rw_db_zipcode($zipcode);
if (!$lz_filter) {
form_set_error('lz_filter', t('Error! We do not have your zip code in our database'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment