? Failure

User tests: Successful: Unsuccessful:

avatar JoomliC
JoomliC
1 Mar 2015

UX Improvement - client-side form validation + com_users frontend label strings

How to Test ?

Note: test example with registration form. You can test with another form (profil, contact, third party form using Joomla client-side form validate...)

Before Patch

Test

  • Resize you window to be around 800px height.
  • Use login form, and click on "Create an account"
  • Click directly on "Register" (by default on a fresh install you have 6 fields required, so you will have 6 fields invalid)

Result

  • The page don't go up to the system message container.
  • Ordering of fields invalid is wrong
  • You have ":" at the end of the labels

After Patch

More than 5 fields required not filled

  • Auto-scroll to the system message container
  • No Field invalid + label displayed (in case of a form with 20 fields required, not filled, could be better than a long list! ;-) )
  • Single content : "All fields with an * are required."

Less than 5 fields required not filled

  • Auto-scroll to the system message container
  • Ordering is the same as the form fields order
  • you don't have the ":" at the end of label

In all cases

  • System message container header : "Please make sure the form is complete and valid."

UX Improvement :

  • correct order of invalid field
  • auto-scroll to system message container if form not valid
  • if more than 5 fields are invalid, do not list all invalid field. Replaced by a single alert message.
  • 2 strings added for client-side form validation (title + single message if more than 5 fields invalid)

Code Standards & Consistency :

avatar JoomliC JoomliC - open - 1 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 1 Mar 2015
Labels Added: ?
avatar n9iels
n9iels - comment - 1 Mar 2015

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.

avatar zero-24 zero-24 - change - 1 Mar 2015
Category Code style JavaScript Language & Strings UI/UX
avatar JoomliC JoomliC - change - 2 Mar 2015
The description was changed
avatar JoomliC
JoomliC - comment - 2 Mar 2015
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 ?

avatar n9iels
n9iels - comment - 2 Mar 2015

Yes thats right, thats right. Seems logic in my opnium. So:
@test succesfull!

avatar zero-24 zero-24 - alter_testresult - 2 Mar 2015 - n9iels: Tested successfully
avatar nternetinspired
nternetinspired - comment - 2 Mar 2015

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:

screen shot 2015-03-02 at 15 52 40

avatar nternetinspired
nternetinspired - comment - 2 Mar 2015

p.s. Some more detail on why I dislike * in general: #4139

avatar n9iels
n9iels - comment - 2 Mar 2015

I thought that was actived by default for the most forms in Joomla!. Looks like a good idea for the contactform. But you still need the validate.js for user who don't work with modern browsers.

@JoomliC is it possiple to integrate this?

avatar JoomliC
JoomliC - comment - 2 Mar 2015

@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.

avatar JoomliC
JoomliC - comment - 3 Mar 2015

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 :

  • I have change the asterisk to icon-asterisk (used no where else in Joomla core).
  • This way, only a styling, and easy to override!
  • I've added class declaration for icon-asterisk in icomoon css and less. And updated Isis and Protostar (so, easy to test B/C with hathor and beez3!)

In label layout, i've done a few change:

  • a script declaration to check if the icon-asterisk class is set.
  • If not, the icon-asterisk class will be replaced by the "old" *.

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 *.

avatar Chalkin
Chalkin - comment - 4 Mar 2015

Tested and works like it should. Joomla 3.4.0


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6247.
avatar Chalkin Chalkin - test_item - 4 Mar 2015 - Tested successfully
avatar infograf768
infograf768 - comment - 5 Mar 2015
  1. As generatecss.php has not been used, isis template-rtl.css is not updated.
  2. After running it to correct the template-rtl.css I get

for LTR:
screen shot 2015-03-05 at 09 33 51

for RTL
screen shot 2015-03-05 at 09 35 11

Apart from the fact that "placement" => "right" obviously does not fit with RTL, this looks very confusing.

avatar infograf768
infograf768 - comment - 5 Mar 2015

using "placement" => "bottom" is a bit better:

screen shot 2015-03-05 at 09 43 16

avatar JoomliC
JoomliC - comment - 5 Mar 2015

@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 :

  • one for joomla client-side form validation improvement (as describe in the first topic)
  • one for the asterisk removal (this could take too much time before having a succesfull feedback...)

@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

avatar JoomliC
JoomliC - comment - 5 Mar 2015

@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).
;-)

avatar Fedik
Fedik - comment - 6 Mar 2015

@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

avatar JoomliC
JoomliC - comment - 6 Mar 2015

@Fedik Thanks, but i wasn't able to know before my PR that the ordering fixed with a PR posted 3 days after mine ;-)

About auto-scroll, i don't see how it could give trouble for an extension form using joomla form-validate, but i miss maybe something... ?

avatar Fedik
Fedik - comment - 6 Mar 2015

@JoomliC true, you could not know, I just ping you for avoid conflicts :wink:

about autoscroll - sometimes very annoying when page "scroll away" from you :smile:
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 :wink:

avatar JoomliC
JoomliC - comment - 6 Mar 2015

@Fedik And thank you to have point me this PR :+1: ;-)

I will check all this, and maybe close this PR...

avatar JoomliC
JoomliC - comment - 14 Mar 2015

I close this PR, in order to open new ones, with no conflict with other PR, created before or after this one.

  • Removal of colon from labels in com_users : #6424
  • Ordering of invalid field in alert container : #6294 (PR opened 2 days after this one, already merged)
  • Removal of hard-coded asterisk * in required fields : in process ;-)
  • Auto-scroll to system message container : could be more user-friendly (better than a little scroll due to the height of the alert box!), but may have some issues #6247 (comment)
avatar JoomliC JoomliC - change - 14 Mar 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-03-14 14:34:41
avatar JoomliC JoomliC - close - 14 Mar 2015
avatar JoomliC JoomliC - close - 14 Mar 2015

Add a Comment

Login with GitHub to post a comment