Moodle

HTML QuickForm displays (some?) disabled elements in a non-accessible way

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8.3, 1.9
  • Component/s: Accessibility
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

When a "frozen" (i.e. disabled) input element is displayed with QuickForm, it is not displayed as usual but with an extra disabled="disabled" attibute, as seems logical. This has two drawbacks that I can think of:

1. Loses uniform appearance with the rest of the GUI, and may even confuse some users.

2. Is probably less accessible to screen readers, who probably handle the disabled checkbox correctly but simply see text in the current case.

I propose changing this behavior for the check box and any other element where it is seen. We could do this by further subclassing from HTML QuickForm (for easy maintenance) or hacking QuickForm itself a bit (if upgrading it is going to be very rare).

Issue Links

Activity

Hide
Nick Freear added a comment -

Hi Jon,
You've had a long wait - sorry!
I totally agree, for screen readers the existing text " [x] " would read "left bracket X right bracket", which is meaningless.

The following is read by JAWS as "Checkbox checked unavailable" - which makes more sense.
<input type="checkbox" disabled="disabled" checked="checked" />

The attached patch is a start, BUT as noted in MDL-11134 it is important to associate a <label> with the control, which I haven't worked out for disabled elements in Quick Forms - please DO NOT commit yet.

Please can Jamie or someone help?
Many thanks

Nick

Show
Nick Freear added a comment - Hi Jon, You've had a long wait - sorry! I totally agree, for screen readers the existing text " [x] " would read "left bracket X right bracket", which is meaningless. The following is read by JAWS as "Checkbox checked unavailable" - which makes more sense. <input type="checkbox" disabled="disabled" checked="checked" /> The attached patch is a start, BUT as noted in MDL-11134 it is important to associate a <label> with the control, which I haven't worked out for disabled elements in Quick Forms - please DO NOT commit yet. Please can Jamie or someone help? Many thanks Nick
Hide
Nick Freear added a comment -

Sorted! Version 2 of the patch overrides parent::getFrozenHtml and gets rid of this::getElementTemplateType (uses parent 'default') for the checkbox.

I've committed this patch to HEAD and 1.8 branch, moved merged tag. Looks and works fine in WinXP/ Firefox 2 and IE 6 (it's a little faint in Firefox default theme - not a big issue).

Show
Nick Freear added a comment - Sorted! Version 2 of the patch overrides parent::getFrozenHtml and gets rid of this::getElementTemplateType (uses parent 'default') for the checkbox. I've committed this patch to HEAD and 1.8 branch, moved merged tag. Looks and works fine in WinXP/ Firefox 2 and IE 6 (it's a little faint in Firefox default theme - not a big issue).
Hide
Nick Freear added a comment -

Fixed!

Show
Nick Freear added a comment - Fixed!
Hide
Petr Škoda (skodak) added a comment -

I have committed the same patch for advcheckbox too

Show
Petr Škoda (skodak) added a comment - I have committed the same patch for advcheckbox too
Hide
Nick Freear added a comment -

Hi Petr
Thanks very much for committing the fix for advcheckbox - this made me realise that my search for this problem in other form controls was flawed - I've found them in at least input, advcheckbox, checkbox, password, radio. I will get busy!

Meantime, I have reported this as a bug in QuickForm and it's successor QuickForm2:
HTML_QuickForm: http://pear.php.net/bugs/12063
HTML_QuickForm2: http://pear.php.net/bugs/12065

Yours, Nick

Show
Nick Freear added a comment - Hi Petr Thanks very much for committing the fix for advcheckbox - this made me realise that my search for this problem in other form controls was flawed - I've found them in at least input, advcheckbox, checkbox, password, radio. I will get busy! Meantime, I have reported this as a bug in QuickForm and it's successor QuickForm2: HTML_QuickForm: http://pear.php.net/bugs/12063 HTML_QuickForm2: http://pear.php.net/bugs/12065 Yours, Nick
Hide
Rod Norfor added a comment -

same patch required for radio button

Show
Rod Norfor added a comment - same patch required for radio button

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: