User tests: Successful: Unsuccessful:
UX Improvement - client-side form validation + com_users frontend label strings
Note: test example with registration form. You can test with another form (profil, contact, third party form using Joomla client-side form validate...)
UX Improvement :
Code Standards & Consistency :
Labels |
Added:
?
|
Category | ⇒ | Code style JavaScript Language & Strings UI/UX |
In how far this change affect other view? For this form it is useful to generalise the error to: All fields with an * are required. But in longer forms with multiple tabs, a message that tells you exactly with field your forget is more useful in my opinion.
@n9iels Thanks for testing!
Of course, this is to be tested with all form using Joomla client-side validation (i have added a note in the PR).
Note that the Field invalid : [label of the invalid field] is display a maximum of 5 times.
When MORE than 5 fields invalid (that why registration, profil.... in frontend could be useful to see the difference when testing this PR) the Field invalid: %s lines are replaced by only one line : All fields with an * are required.
In case of a long form, with a lot of required fields, it make sense, in my opinion, to not display all the fields invalid, to prevent a long list of invalid fields! (that's why i have set a limit of 5 errors, and if more, a sentence that all fields with an asterisk are required).
In case of your test with Article, you should have this :
Please make sure the form is complete and valid. Invalid field: Title
Right ?
Required fields may not have * next to them, and in fact accessibility and therefore UX is improved when they do not.
Maybe it is better to allow the browser to handle form validation? Modern browsers will not post a form with missing required values and they provide excellent, and very detailed, user feedback for each required field, directly on the field itself, e.g:
@nternetinspired Thank you for this good reading! (with many pros and cons really interesting) I will take it into account about the string, to not add one with an asterisk ;-)
Note that this PR is about improvement, not refactory...
@n9iels yes, i will check this, and see what could be done now, and what could be done later. So test are delayed.
PR updated to take into account this PR : #4139
This PR is not Ready to Commit, as it introduces icon-asterisk to replace *, and currently only strings for library and com_users are edited to remove the * from language strings.
You can test this both in admin and site side.
And everywhere there's a form with required fields.
About Main change concerning use of asterisk, related to #4139 :
In label layout, i've done a few change:
The goal of this : to allow now to use custom css in a site template to style the required icon.
If a template is not ready for this (you could test with beez or hathor) the * will be used.
@nternetinspired You may find it better now... I hope! ;-)
@phproberto @brianteeman i think your will be concerned in keeping a icon-asterisk on required fields, and to be B/C as far as possible! (indeed, improvement about accessibility for all templates)
All comments are welcome, and all error reports too! this is a first try to improve the joomla client-side validation and to allow better styling by removal of the core *.
Tested and works like it should. Joomla 3.4.0
@infograf768 Yes, i not have yet run the generate css, due to a personal issue in my local folder where i've done this dev... But i will as soon as i get the green light to go futher, and so, replace all the * with the icon-asterisk.
As the main purpose of this PR was to improve client-side validation, i was just using it to test * replacement as it seems to be a commit block....
If it's okay (i mean some PLT, designer, and a few contributors "OK it's all good!"), i will update this one to a clean full PR with client-side improvement (joomla one) + replacement of * by icon (remove the hardcoded " *" from the core layout).
If no feedback soon, i will split this PR in two :
@infograf768 what is you personal opinion about this change, the addition of icon, and the abbr tag with title for accessibility (reader) in a user point of view as well as in a translator expert view ? (Hope you are fine since your "Retraite Joomla" ;-) )
Cyril
@Chalkin Thank you for your testing! Indeed, this PR is not yet ready to commit, as it introduces at it is today, a major change and could need more feedback before to do all the full changes needed.
But of course, testing and giving feedback is welcome, as well as its B/C compatibility with all templates (admin/site).
;-)
@JoomliC please pay attention on #6294 that also made changes in validate.js
and it already RTC,
there the field ordering already fixed
and note about 'Auto-scroll to the system message container',
it is very controversial feature, please do not enable it by default, so extension/template developers will have no problem with it
@JoomliC true, you could not know, I just ping you for avoid conflicts
about autoscroll - sometimes very annoying when page "scroll away" from you
so I mean keep it disabled by default, and add some JS option for enable, so example you can enable it only for specific view, and if some extension developer want this to, he also can just enable it via js option
also for some templates can be a problem if it cannot be disabled without hacking,
example if the message container somewhere in absolute/fixed position then autoscroll can work wrong
but it just personal opinion
I close this PR, in order to open new ones, with no conflict with other PR, created before or after this one.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-14 14:34:41 |
Good one!, but please notice this change also affect the administrator side!
But in this case that's something good I thinks so, for example add a new article and "forget" to fill in a title. The error message now contains your
<h4>
title, but is not containing the new error message.In how far this change affect other view? For this form it is useful to generalise the error to: All fields with an * are required.
But in longer forms with multiple tabs, a message that tells you exactly with field your forget is more useful in my opinion.