Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update postcode field to GDS guidance #303

Closed
terrysimpson99 opened this issue Jan 18, 2021 · 1 comment
Closed

Update postcode field to GDS guidance #303

terrysimpson99 opened this issue Jan 18, 2021 · 1 comment
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@terrysimpson99
Copy link

Describe the bug
This all about the 'Enter a postcode' field at: https://coronavirus.data.gov.uk/

  1. The postcode field uses html5 validation. GDS guidance says: "Turn off HTML5 validation" and "To turn off HTML5 validation, add ‘novalidate’ to your form tags." (See https://design-system.service.gov.uk/patterns/validation/ )
    Go to https://coronavirus.data.gov.uk/
    Go to the 'Enter a postcode' field
    Type 'sw1a'
    Press the magnifying glass icon
    System responds with a coloured exclamation mark and "Please match the format requested."
    I would expect an error message like 'Enter a UK postcode'

Screenshot
image

  1. The postcode field does not accept redundant characters. Users add these and sometimes can't see what's wrong (particularly if they are spaces which are invisible, of course). GDS guidance says: "It is easier for users if you accept and ignore unwanted characters. This is better than rejecting the input and telling a user they’ve not provided a valid postcode. You should allow postcodes that contain upper and lower case letters, no spaces, additional spaces at the beginning, middle or end and punctuation like hyphens, brackets, dashes and full stops."
    Go to https://coronavirus.data.gov.uk/
    Go to the 'Enter a postcode' field
    Type ' SW1A 0AA' [preceding space], or 'SW1A 0AA' [double space in middle], or 'SW1A-0AA' [hyphen], or 'SW1A 0AA.' [full stop], or 'SW1A 0AAA' [extra character]
    Press the magnifying glass icon
    System responds with a coloured exclamation mark and "Please match the format requested."
    I would expect each of the above examples to produce a result as if the user had typed 'SW1A 0AA'

HP laptop
Windows 10.0.19042
Chrome Version 87.0.4280.141 (Official Build) (64-bit)

Additional context
We addressed this issue by stripping all non-postcode characters and then putting space 3 characters from end. We did this prior to validation. See: https://github.com/hmrc/voa-bar-xml-frontend/blob/master/app/journey/PostcodeValidator.scala

Trying to help. Keep up the good work

@xenatisch
Copy link
Contributor

This is not bug. For compliance queries, please get in touch via the email provided on the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants