This module defines a (validated) postcode field for …
- Form-API - This is mainly useful for developers.
- A webform-component including form_builder support.
Dependencies
- This module leverages postal_code_validation
- little_helpers for webform support.
Usage of the form-API type
$form['postcode1'] = [
'#type' => 'postcode',
'#title' => t('UK Postcode'),
// The postcode must be valid for the given country. (optional)
// If no country is specified the "first" country where the value
// is a valid postcode is assumed.
'#postcode_country' => 'GB',
// form-#parents of a form-field that is used to select the country. (optional)
// Only evaluated if #postcode_country is empty.
'#postcode_country_parents' => ['select', 'country'],
];
Supporting organizations:
developed this module as part of campaignion.
Project information
- Project categories: Developer tools
2 sites report using this module
- Created by torotil on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
