Wp-calypso: Checkout: validation errors on mobile

Created on 26 Nov 2015  路  12Comments  路  Source: Automattic/wp-calypso

Originally reported by @scruffian.

If I have an error when checking out on mobile, it becomes difficult to complete the checkout form, because the errors hide the fields, so I can't edit them. When I scroll the error doesn't move away, so I have to dismiss it. The obvious solution to this is show the errors inline, but that's not a quick fix.

img_2759

Checkout [Type] Bug

Most helpful comment

Though with the current design of the form it can be hard to provide flexible solution for the longer error messages.

This is a known issue, and one of the reasons we haven't moved to inline validation yet, as it would require a rethink of the form design (and likely a/b testing to make sure there isn't any major impact on revenue). The checkout form was one of the earliest pieces that we designed for Calypso store, so it's quite out of sync with the current patterns.

The simplest option here would probably be moving country and postal code to their own line, giving both a bit more room for inline validation, all fields going to full width at the <480px breakpoint. A quick inspector mockup:

screen shot 2016-10-07 at 7 12 16 am

Another thing noted in checkout is that the label originally used the "float label" pattern, but that appears to be broken, causing a usability problem (once you start typing in a field, there's no longer any indication of what that field is). We should probably update to use the Calypso standard labels at this point (this could be handled in a separate PR but just wanted to note it here). @mikeshelton1503 previously mocked up a version of this for Purchases:

screen shot 2016-10-07 at 7 20 34 am

All 12 comments

It looks like CSS handling has changed a bit.

360x640:

screen shot 2016-10-05 at 14 12 16

412x732:

screen shot 2016-10-05 at 14 13 16

320x568:

screen shot 2016-10-05 at 14 13 48

@mtias @folletto @breezyskies @MichaelArestad Do you feel like we really should be able to inline error messages or should we rather make sure we don't create such long error notices? :D

I think that we might also show only the first error for a given field in this case or even figure out if we could group errors by type.

should we rather make sure we don't create such long error notices

Definitely this. We haven't discussed this thoroughly so might be just my opinion, but any notice that is longer than a few words, one line, should be reconsidered.

That said, this one probably requires some kind of quick fix to start with. :P

@fabianapsimoes It looks like this issue happens only when you click Save Card or Checkout button (depending on the flow) on the empty form. We might also display all messages only when user tries to submit form, but display only the last message when user goes to the next field? Then we would make it much more user friendly as a bonus :)

Yep, that seems to be the case indeed. I'm going to page @ranh and @breezyskies here, with regards to simplifying the copy and input on when to display the messages. I like the suggestion to show validation on blur, but I wonder if it can get annoying easily.

I agree that this notice could use a rethink. Both the copy and the presentation are not ideal. For example terms like "issue", "field", and "invalid" don't have to be used. There is unnecessary repetition for every field that is missing, when a simple "please fill all missing details" might have been enough.

I can help out with copy based on how we decide to proceed.

I double checked what is the current status of HTML5 form validation. It looks like it has improved a lot and it works almost in 100% for the browsers we support. See http://caniuse.com/#feat=form-validation.

I think it would make perfect sense to use built-in HTML form validation when user types in form fields, and only show notice when user tries to submit the form. What do you think?

I also did an experiment and added required property to all form fields. This is how it changed validation flow:

form-validation-required

It was super simple change and without too much thinking reduced list of errors to the absolute minimum. We are able to inline also invalid field errors messages in a similar fashion.

@gziolo Oh, interesting! How much can we style the native validation messages, so it's closer to Calypso's feel?

I bet we can customize it fully :) I'm sure we can customize error messages. I have seen also articles where they suggest hiding default messages and provide own experience instead. I'll explore it further tomorrow.

@fabianapsimoes it turns out we don't have any control over UI of the error messages. Every browser provides their own styles. We can only change the message displayed to the user.

Taking that into account, we probably should skip all HTML5 implementations and move error handling inline like this if we want to keep one style of handling forms in Calypso:

screen shot 2016-10-07 at 12 36 10

Though with the current design of the form it can be hard to provide flexible solution for the longer error messages.

For the reference screen from devdocs forms section:
screen shot 2016-10-07 at 12 48 30

Though with the current design of the form it can be hard to provide flexible solution for the longer error messages.

This is a known issue, and one of the reasons we haven't moved to inline validation yet, as it would require a rethink of the form design (and likely a/b testing to make sure there isn't any major impact on revenue). The checkout form was one of the earliest pieces that we designed for Calypso store, so it's quite out of sync with the current patterns.

The simplest option here would probably be moving country and postal code to their own line, giving both a bit more room for inline validation, all fields going to full width at the <480px breakpoint. A quick inspector mockup:

screen shot 2016-10-07 at 7 12 16 am

Another thing noted in checkout is that the label originally used the "float label" pattern, but that appears to be broken, causing a usability problem (once you start typing in a field, there's no longer any indication of what that field is). We should probably update to use the Calypso standard labels at this point (this could be handled in a separate PR but just wanted to note it here). @mikeshelton1503 previously mocked up a version of this for Purchases:

screen shot 2016-10-07 at 7 20 34 am

With #8666 I want to address form fields changes:

The simplest option here would probably be moving country and postal code to their own line, giving both a bit more room for inline validation, all fields going to full width at the <480px breakpoint.

Then I would like to create a follow-up PR where we could add logic to AB test changes related to error handling and maybe experiment with the "float label" pattern.

Closing because this was effectively tackled in #8666, and it now appears like this:

screen shot 2018-03-08 at 15 50 00

Was this page helpful?
0 / 5 - 0 ratings