Commit d3d1023a authored by git's avatar git Committed by bojanz
Browse files

Issue #3025983 by Marios Anagnostopoulos: Add a pattern attribute to the postal code field

parent d6956b25
......@@ -269,6 +269,10 @@ class Address extends FormElement {
if (isset($element['address_line2'])) {
$element['address_line2']['#title_display'] = 'invisible';
// Allow the postal code pattern to be used for client side validation.
if (isset($element['postal_code'])) {
$element['postal_code']['#attributes']['pattern'] = $address_format->getPostalCodePattern();
// Add predefined options to the created subdivision elements.
$element = static::processSubdivisionElements($element, $value, $address_format);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment