Address - smbc-digital/form-builder GitHub Wiki
Refer to Stockport Design System for styling information and reference images
DSL properties
Property | Type | Required | Default Value | Description |
---|---|---|---|---|
QuestionId | string | ✔️ | ❌ | Unique question id allowed charatcers are [a-zA-Z] only |
AddressProvider | enum | ✔️ | ❌ | Address provider used for address data lookup |
AddressLabel | string | ✔️ | ❌ | Label associated with the search term |
SelectLabel | string | ✔️ | Select the address from the list | Label associated with the select dropdown |
Hint | string | ❌ | ❌ | hint which appears above the postcode input |
SelectHint | string | ❌ | ❌ | hint which appears above the select input |
AddressManualHint | string | ❌ | ❌ | hint which appears above the manual address inputs |
AddressManualLinkText | string | ❌ | I cannot find the address in the list | Ability to change the default link text for navigating to the manual address view |
AddressManualLineMaxLength | string | ❌ | 95 | Max length for 'Address line1', 'Address line 2' and 'Town or city' fields |
AddressManualPostcodeMaxLength | string | ❌ | 8 | Max length for 'Postcode' field |
Optional | bool | ❌ | false | |
StockportPostcode | bool | ❌ | false | Allow only Stockport postcodes, This will add the addressIAG message if enabled |
CustomValidationMessage | string | ❌ | ❌ | Set a custom validation message for when user does not enter a postode) There is automatic validation there is not a valid postcode |
SelectCustomValidationMessage | string | ❌ | ❌ | Set a custom validation message for when user does not select an address from the dropdown |
TargetMapping | string | ❌ | ❌ | Used for custom object mapping when creating submit data |
AddressIAG | string | ❌ | You must live in Stockport. | Ability to change the AddressIAG displayed when StockportPoscode is enabled |
StrongLabel | bool | ❌ | true | Labels associated to inputs are strong |
MaxLength | int | ❌ | 200 | |
LabelAsH1 | bool | ❌ | false | Display Label as h1 not a label (if this is set to true, HideTitle in the Page properties should also be set to true) |
DisableManualAddress | bool | ❌ | false | Used to disable manual address input in favour of a Detail element with IAG |
NoManualAddressDetailText | string (Html.Raw) | ❌ | ❌ | Content to be displayed in manual address Detail section. Telephone numbers should be in bold. NOTE: This is handled as raw html |
ValidatePostcode | bool | ❌ | true | Disable validation of the address control - this will allow non-standard zip or overseas postal codes |
SummaryLabel | string | ❌ | ❌ | Change the label associated with this input on the summary |
Manual Address
Further work needed to enable the manual address to work. At the moment the manual address is overridden for forms with Street element value. For forms that only has an Address element the property called 'DisableManualAddress' need to set to 'True' to ignore the manual address
Address examples
DS Json for address:
{
"Title": "What is your home address?",
"PageSlug": "address",
"HideBackButton": true,
"Elements": [
{
"Type": "Address",
"Properties": {
"QuestionId": "address",
"AddressProvider": "Fake",
"StrongLabel": true,
"SelectLabel": "Select an address",
"AddressLabel": "Enter your postcode",
}
},
{
"Type": "Button",
"Properties": {
"ButtonId": "nextStep",
"Text": "Continue"
}
}
]
All possible properties example:
{
"Title": "What is your home address?",
"PageSlug": "address",
"HideBackButton": true,
"Elements": [
{
"Type": "Address",
"Properties": {
"QuestionId": "address",
"AddressProvider": "Fake",
"StrongLabel": true,
"AddressLabel": "Enter your postcode",
"SelectLabel": "Select an address",
"LabelAsH1": true,
"StockportPostcode": true,
"AddressIAG": "The address you enter must be within stockport",
"TargetMapping": "customer.address",
"CustomValidationMessage": "Please enter a valid postcode",
"SelectCustomValidationMessage": "Please select an address",
"AddressManualLinkText": "Enter address manually",
"Hint": "Enter a postcode e.g. sk11aa",
"SelectHint":"Select a address from the dropdown or use the manual entry",
"AddressManualHint":"Enter your address line 1, line 2, and postcode",
"Optional": true,
"DisableManualAddress": true,
"NoManualAddressDetailText": "If you cannot find your address in the list please call <b>0161 217 6111</b> to report the flood",
"AddressManualLineMaxLength": 150,
"AddressManualPostcodeMaxLength": 20,
}
},
{
"Type": "Button",
"Properties": {
"ButtonId": "nextStep",
"Text": "Continue"
}
}
]
Key | Property |
---|---|
1 | Page:Title |
2 | Page:Button |
3 | StockportPostcode/AddressIAG |
4 | AddressLabel |
5 | SelectLabel |
6 | AddressManualLinkText |
7 | This IAG will only appear if the users search postcode returns 0 results |