Skip to content

PostalCodeAndCity

Demos

Empty

<Field.PostalCodeAndCity
postalCode={{
onChange: (value) => console.log('postalCode onChange', value),
}}
city={{
onChange: (value) => console.log('city onChange', value),
}}
/>

Placeholder

<Field.PostalCodeAndCity
postalCode={{
placeholder: '????',
onChange: (value) => console.log('postalCode onChange', value),
}}
city={{
placeholder: 'Your city..',
onChange: (value) => console.log('city onChange', value),
}}
/>

Label

<Field.PostalCodeAndCity
postalCode={{
label: 'PNR',
onChange: (value) => console.log('postalCode onChange', value),
}}
city={{
label: 'CTY',
onChange: (value) => console.log('city onChange', value),
}}
/>

Label and value

<Field.PostalCodeAndCity
postalCode={{
label: 'Pnr.',
value: '0788',
onChange: (value) => console.log('postalCode onChange', value),
}}
city={{
value: 'Oslo',
onChange: (value) => console.log('city onChange', value),
}}
/>

Disabled

<Field.PostalCodeAndCity
postalCode={{
value: '1234',
disabled: true,
onChange: (value) => console.log('postalCode onChange', value),
}}
city={{
value: 'Oslo',
disabled: true,
onChange: (value) => console.log('city onChange', value),
}}
/>

Error

This is what is wrong...
<Field.PostalCodeAndCity
postalCode={{}}
city={{}}
error={new FormError('This is what is wrong...')}
/>

Validation - Required

<Field.PostalCodeAndCity
postalCode={{
required: true,
}}
city={{
required: true,
}}
/>