Skip to content

Import

import { Field } from '@dnb/eufemia/extensions/forms'
render(<Field.PostalCodeAndCity />)

Description

Field.PostalCodeAndCity is a wrapper component for input of two separate input of strings with user experience tailored for postal code and city values.

These fields is meant for Norwegian postal codes and cities. The postal code input takes a 4-digit string as values, since it's meant for Norwegian postal codes. A Norwegian postal code can have a leading zero, which is why the value is a string and not a number. More info about postal codes can be found at Posten.

It supports the HTML autocomplete attribute, and by default set it to postal-code for the postal code field, and to address-level2 for the city field.

There is a corresponding Value.PostalCodeAndCity component.

Relevant links

Validation and autofill

Read more about how to use the Bring API to validate and autofill a postal code and city name.