You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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)
Describe the bug
This all about the 'Enter a postcode' field at: https://coronavirus.data.gov.uk/
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
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
The text was updated successfully, but these errors were encountered: