Created
January 7, 2009 19:17
-
-
Save akahn/44372 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Zips must be 5-digit integers and email addresses must be valid. | |
*/ | |
function email_zip_validate($form, &$form_state) { | |
if (!is_numeric((int)$form_state['values']['zip']) || strlen($form_state['values']['zip']) != 5) { | |
form_set_error('zip', t('The zip code you entered was not valid. Please try entering it again.')); | |
} | |
if (!valid_email_address($form_state['values']['email'])) { | |
form_set_error('email', t('The email address you entered was not valid. Please try entering it again.')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment