User Notification

Back to Overview
00:00 --> 00:06
Notifications. They are important for giving the user feedback on what's happening on the form.

00:06 --> 00:11
There are many ways to do that. Here are a couple of best practices mainly.

00:13 --> 00:19
And you would be, if you're testing, you would just make sure that one of these is available.

00:20 --> 00:27
So for overall feedback, things like, oh, I've just sent that form and there was an error in it or it worked.

00:28 --> 00:32
Putting it into the main heading is a very good way to do it.

00:33 --> 00:35
You can also put it in the page title.

00:35 --> 00:40
The page title is always read the first thing when you submit something.

00:41 --> 00:47
So this is basically the first feedback for the user.

00:48 --> 00:51
You can use dialogues like this safe dialogue.

00:52 --> 00:53
Thanks for submitting the form.

00:54 --> 00:55
That works.

00:56 --> 00:59
Usually don't want to do that.

00:59 --> 01:06
But, you know, if you're using JavaScript, you need to at least give some feedback to the user that something has happened.

01:06 --> 01:12
Nothing is more frustrating than clicking a button and don't know if something happens.

01:12 --> 01:14
And then you click it again and again.

01:14 --> 01:19
And then you see that you have actually submitted that comment seven times instead of once.

01:22 --> 01:24
Then you want to list errors.

01:24 --> 01:32
that's also a very good approach. Just make sure, like in this example, that all the errors are

01:32 --> 01:37
listed. The first name field is empty, a required field must be filled, it's a required field,

01:37 --> 01:46
it must be filled in. And this links actually, that's the idea behind this example, links to the

01:47 --> 01:53
form field. And the date field is in the wrong format, it should be similar to, like, the format

01:53 --> 02:05
that is used. Yeah, and here it's in a role alert. This will be announced when it's added to the page.

02:05 --> 02:13
So if you're using that to add it through JavaScript, then it would be announced immediately, which can be quite useful.

02:16 --> 02:32
Yeah, you can think about using aria-describedby to the error message. You want to mark the erroneous field in some way.

02:34 --> 02:49
So there's also inline feedback, you know, after submit, like here, imagine we have submitted this, just this is like, okay, username, check, and error expiry date, use the format mm, y, y, y, y.

02:49 --> 02:55
And we did, you know, we did have a dot here, so we can't actually submit this.

02:56 --> 02:58
Does this reload? Probably.

03:01 --> 03:08
So, so yeah, just, you know, having a tick, having some indicator that, yeah, this is correct.

03:08 --> 03:13
And then having like an error here, that's good, a good way to do it.

03:17 --> 03:27
And of course, I mean, this goes without saying, you should not only distinguish stuff using colors.

03:27 --> 03:39
So here, if you have, if you leave out okay and error here, then someone with colorblindness might see this as the same color.

03:39 --> 03:50
And we can actually take a look here and say here, this is deuteranomaly.

03:53 --> 03:54
Deuteranomaly.

03:54 --> 03:55
That's what I wanted to say.

03:55 --> 03:58
I'm really terrible pronouncing these.

03:59 --> 04:04
And you can see that it is like harder to see.

04:04 --> 04:14
And then, you know, if you look at Deuteronopia, it's even impossible to distinguish between those two colors.

04:14 --> 04:16
So you always want to have the word in there.

04:17 --> 04:23
Protonomaly, that works pretty well with this color combination, but it's problematic with others.

04:24 --> 04:33
And Protonopia also hard to see what the difference is. So yeah, using colors alone, never a good idea.

04:36 --> 04:38
Oh, switch that off.

04:43 --> 04:48
And if I just scrolled up and said like, oh, don't use colors to distinguish that.

04:48 --> 04:50
And you go like, they do have different colors.

04:50 --> 04:51
Yes, they do.

04:51 --> 04:53
This is like a green and this is red.

04:53 --> 05:02
And you might want to get checked for like color vision deficiencies and see if there's

05:02 --> 05:08
something you can do in your settings to make this easier to see because there are like

05:08 --> 05:10
color boosters or color shifters that you can use.

05:10 --> 05:18
But yeah, that's, I'll always remember to put text on those things.

05:21 --> 05:23
Sometimes you want to give feedback while typing.

05:23 --> 05:29
I'm not a big fan of this, to be honest, because it's like, it's like it's immediate feedback

05:29 --> 05:31
and it can be a little bit rough.

05:31 --> 05:36
So if I put a username in here, like YA, that is okay.

05:36 --> 05:41
That is, and then I go T-I-L, and this username is taken.

05:41 --> 05:44
So I get this, sorry, this username is taken message.

05:45 --> 05:50
And because we have the ARIA live polite, as I said, we talk about ARIA next week.

05:51 --> 05:54
This would be announced as soon as you stop typing.

05:54 --> 05:55
That's why it's polite.

05:57 --> 05:59
This is the example of the JavaScript.

05:59 --> 06:01
That doesn't matter for us at all.

06:02 --> 06:09
Then you can have scale feedback, like in this case, it's a password testing field and

06:09 --> 06:11
you want to give feedback.

06:11 --> 06:14
And here we also do like the same thing.

06:14 --> 06:29
So if I go and my password is "yatil23great@at123".

06:29 --> 06:31
So this is now my password.

06:31 --> 06:32
It says it's a strong password.

06:33 --> 06:35
I don't think that this is a particularly strong password.

06:36 --> 06:37
It's also not my password.

06:38 --> 06:39
It's nowhere my password.

06:39 --> 06:41
I promise it's not my password.

06:42 --> 06:46
But you see that it has these like different layers of information.

06:46 --> 06:54
So if I go into like the middle where it's yellow, this pale yellow is too yellow, too bright.

06:54 --> 07:01
It doesn't have enough contrast to the gray background.

07:01 --> 07:09
So this should be a different color, but you know, it is what it is. But it has the track, it has the

07:11 --> 07:18
actually, I think we should go in here. This is better, a little bit more contrast. So it has the

07:18 --> 07:29
track, it shows nicely where you are on the scale. And then it also has weak password, cracked in six

07:29 --> 07:37
days. I shouldn't use this password anymore. I do not. And he is correct in centuries. I don't think

07:37 --> 07:45
that JavaScript code is very reliable on that. But, you know, this is like basically the example

07:45 --> 07:53
you get like an update while you're typing. And for that, things like the ARIA live approach

07:53 --> 07:59
makes a lot of sense because you basically want the user to stay in this field until they are

07:59 --> 08:07
sure that they have chosen a password that is secure enough. Then you can have unfocus change.

08:07 --> 08:14
So if I'm focused in here and I change to the next one, now in this case this is the next field,

08:15 --> 08:23
it updates this example and says like expiry date use the format mm yy. Now if you

08:23 --> 08:30
you jump away from the field that means you probably don't go back uh so it doesn't doesn't

08:30 --> 08:37
matter a lot i think if you're doing this uh then you yeah you need to put in aria live uh and

08:37 --> 08:43
because this happens after you jumped out it would use aria live assertive which basically announces

08:43 --> 08:49
it immediately so you jump to the next thing and it immediately announces what's happening

08:49 --> 08:54
but we will talk about aria next week this is a big tease really