govuk-frontend-wtf
govuk-frontend-wtf copied to clipboard
Automatically pass maxlength param to character count templates
Is your feature request related to a problem? Please describe.
When using the GovCharacterCount
you have to set the length limit in both the WTForm field validator and pass the maxlength
param to the template.
Describe the solution you'd like Take the max length set in the validator and pass it as a default param to the template, so that developers don't have to set it twice, and risk missing or not changing one.
Describe alternatives you've considered None other than the current approach
Additional context
The maxlength
param must always be equal to the length.max
validator.