Page MenuHomePhabricator

Document how to do Field validation on blur
Closed, ResolvedPublic

Description

The Field documentation says:

Setting the status based on field validity is up to you. In the example below, it's done as you're changing the input. You could also validate on blur to give the user a chance to finish filling out the field.

However, it then doesn't provide an example of how to delay validation until blur, and it's not immediately obvious (at least to me) how you would do this. It would be helpful if the documentation included an example of how to do this, so that we can establish a pattern that we want developers to follow when doing validation on blur.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Catrope the complex field demo validates on text input blur - would it be enough to link to this example, or do you think we should have separate examples explaining and demonstrating validation?

Oh I missed that demo! Yes let's link to that demo then, and maybe we can also change the setting for the side menu on that page so that h4's are included (I didn't realize those demos existed because they're not listed in the side menu).

Change 987811 had a related patch set uploaded (by Catrope; author: Catrope):

[design/codex@main] docs, Field: Flatten fieldset examples and cross-link them

https://gerrit.wikimedia.org/r/987811

Change 987811 merged by jenkins-bot:

[design/codex@main] docs, Field: Flatten fieldset examples and cross-link them

https://gerrit.wikimedia.org/r/987811

Change 989250 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/core@master] Update Codex from v1.2.0 to v1.2.1

https://gerrit.wikimedia.org/r/989250

Change 989250 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.2.0 to v1.2.1

https://gerrit.wikimedia.org/r/989250