? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
13 Aug 2018

With J4 we have the ability to use html5pattern validation. Where relevant this is much better than using php validaton. php validation only takes place on submit so

  • you have to wait until the end to know you made a mistake
  • the resulting error message is not inline with the field that is wrong - very important for a11y and ux

[more info about html5patterns here #18995]

This POC adds the ability to use JText for the validationmessage

For purely test purposes I have updated one field - the username for the Super User account in the installer.

If this concept is accepted then it can be applied in many places throughout joomla

Note we have different validation routines currently (js and php) and they are not consistent nor do they always work as intended see report by @astridx #19301

avatar brianteeman brianteeman - open - 13 Aug 2018
avatar brianteeman brianteeman - change - 13 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2018
Category Installation Language & Strings Libraries
avatar wilsonge
wilsonge - comment - 13 Aug 2018

I'm ok with the principle of this - but as we're now going to be doing this in 3 places can we please use this opportunity to sync things up in terms of the regex used as per #19301 Just make it clear in each PR what regex is being changed (if any)

avatar brianteeman
brianteeman - comment - 13 Aug 2018

That's the big issue - locating all the different validations

avatar brianteeman
brianteeman - comment - 13 Aug 2018

Also it can't be used everywhere. For example in the admin we allow the site owner to create their own rules for usernames and passwords so we can't have a pattern

avatar wilsonge
wilsonge - comment - 13 Aug 2018

For example in the admin we allow the site owner to create their own rules for usernames and passwords so we can't have a pattern

I think you should be able to build up a regex to inject in PHP using the getOptions/setOptions JS API

That's the big issue - locating all the different validations

Honestly for now as long as the JFormRule* classes regex and the JS regex in this file match up - it's good enough for now. Those two are the main sources of regex in the system (I'm ignoring the stuff in JFilterInput as that's generic and in most cases won't have a JS associated filter I don't think).

avatar brianteeman brianteeman - change - 15 Aug 2018
Labels Added: ? ?
avatar brianteeman
brianteeman - comment - 25 Sep 2018

Closed - I don;t have the time to do this

avatar brianteeman brianteeman - close - 25 Sep 2018
avatar brianteeman brianteeman - change - 25 Sep 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-09-25 18:31:29
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment