We use cookies to help you with journey planning and relevant disruptions, remember your login and show you content you might be interested in. If you’re happy with the use of cookies by West Midlands Combined Authority and our selected partners, click ‘Accept all cookies’. Or click ‘Manage cookies’ to learn more.
{% from "wmnds/components/form-elements/date-input/_date-input.njk" import wmndsDateInput %}
{{
wmndsDateInput({
id: "passport-date",
required: true,
error: false,
errorMessage: {
id: null,
contextText: "The date your passport was issued must be in the past",
contextHTML: null,
classes: null
},
formGroup: {
classes: "wmnds-m-t-20"
}
})
}}
Nunjucks properties
Name
Type
Description
id
string
Required. Must be unique. The id of the group of inputs.
required
boolean
If true, input is required/must be filled out. Defaults to false.
error
boolean
If true, error will be displayed. Defaults to false.
errorMessage
object
Options for the error message component. See errorMessage.
formGroup
object
Options for the form-group wrapper. See formGroup below.
Options for errorMessage
Name
Type
Description
id
string
Id attribute to add to the error message span tag.
contentText
string
Required. Text to use within the error message. If contentHTML is supplied, this is ignored.
contentHTML
string
Required. HTML to use within the error message
classes
string
Classes to add to the error message span tag.
Options for formGroup
Name
Type
Description
classes
string
Classes to add to the form group (e.g. to show error state for the whole group)
{% from "wmnds/components/form-elements/date-input/_date-input.njk" import wmndsDateInput %}
{{
wmndsDateInput({
id: "passport-date",
required: true,
error: false,
errorMessage: {
id: null,
contextText: "The date your passport was issued must be in the past",
contextHTML: null,
classes: null
},
formGroup: {
classes: "wmnds-m-t-20"
}
})
}}
Nunjucks properties
Name
Type
Description
id
string
Required. Must be unique. The id of the group of inputs.
required
boolean
If true, input is required/must be filled out. Defaults to false.
error
boolean
If true, error will be displayed. Defaults to false.
errorMessage
object
Options for the error message component. See errorMessage.
formGroup
object
Options for the form-group wrapper. See formGroup below.
Options for errorMessage
Name
Type
Description
id
string
Id attribute to add to the error message span tag.
contentText
string
Required. Text to use within the error message. If contentHTML is supplied, this is ignored.
contentHTML
string
Required. HTML to use within the error message
classes
string
Classes to add to the error message span tag.
Options for formGroup
Name
Type
Description
classes
string
Classes to add to the form group (e.g. to show error state for the whole group)