Issue Details (XML | Word | Printable)

Key: MDL-15797
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Jamie Pratt
Reporter: Jenny Gray
Votes: 1
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Required fields explanation should move to top of form

Created: 23/Jul/08 08:28 PM   Updated: 10/Feb/09 10:34 AM
Component/s: Forms Library
Affects Version/s: 1.9.2
Fix Version/s: None

File Attachments: 1. Text File requirednote.txt (1 kB)
2. Text File usabilitypatch.txt (1 kB)

Issue Links:
Dependency
 
Duplicate
 

Participants: James Brisland, Jamie Pratt and Jenny Gray
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
We had some usability testing done on openlearn (http://openlearn.open.ac.uk) and they suggested that the text which explains the red * for required form fields should be listed at the top of the form rather than (or perhaps as well as) at the bottom.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Jenny Gray added a comment - 23/Jul/08 08:30 PM
Attaching this to the GSoc Usability issues work as something they might want to pick up.

James Brisland added a comment - 23/Jul/08 08:40 PM
I have created a patch for this issue.

File changed is lib/pear/HTML/QuickForm/Renderer/Tableless.php


Jamie Pratt added a comment - 24/Jul/08 12:21 PM
Hi,

Thanks for the patch.

In general we have avoided modifying the pear code itself and confined our modifications to classes that subclass the pear classes.

I attach another patch which modifies lib/formslib.php instead of the pear files.

But still there is a problem with this patch. I don't know why this is being done :

+ $requiredNote = $form->getRequiredNote();
+ // replace default required note by DOM/XHTML optimized note
+ if ($requiredNote == '<span style="font-size:80%; color:#ff0000;">*</span><span style="font-size:80%;"> denotes required field</span>') { + $requiredNote = '<span class="required">*</span> denotes required field'; + }

If you want to change the default html for the required note we should modify the form class in lib/formslib.php where it is set in the constructor.


Jamie Pratt added a comment - 24/Jul/08 12:22 PM
Attaching requirednote.txt

Jenny Gray added a comment - 24/Jul/08 04:09 PM
OK I quite understand about not wanting to change the pear libraries, that makes a lot of sense. Your patch is better.

The reason for the HTML mangling is simply that that's what the pear code does. Take a look at function finishForm in the Tableless.php file. James' patch is just a direct copy. Though why they want to do that is a mystery!