function currency_form_element_validate_iso_4217_number in Currency 7.2
Implements Form API #element_validate callback.
1 string reference to 'currency_form_element_validate_iso_4217_number'
- currency_form_currency in currency/
currency.module - Implements Ctools exportable UI edit form callback.
File
- currency/
currency.module, line 592 - Provides currency information and allows users to add custom currencies.
Code
function currency_form_element_validate_iso_4217_number(array $element, array $form, array &$form_state) {
if ($element['#value'] && !preg_match('/\\d{3}/i', $element['#value'])) {
form_error($element, t('@title should be three digits.', array(
'@title' => $element['#title'],
)));
}
}