PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm_Renderer_Tableless » Bug #8523

"date" element label not showing up

Details

Submitted2006-08-21 04:29 UTC
Fromeduardo593734256 at gmail dot com
Assignedwiesemann
StatusClosed
PackageHTML_QuickForm_Renderer_Tableless
PHP VersionIrrelevant
OSWindows
Roadmaps(Not assigned)

Comments

[2006-08-21 04:29 UTC] eduardo593734256 at gmail dot com

Description:
------------
The select id is not being generated.

Test script:
---------------
$form->addElement('date', 'inicio', 'Início:', array('language' => 'pt-br', 'format' => 'H:i', 'optionIncrement' => array('i' => 5)));

Expected result:
----------------

Início:

00
...
23

:

00
...
55

Actual result:
--------------

Início:

00
...
23

:

00
...
55

[2006-08-24 06:19 UTC] eduardo593734256 at gmail dot com

Hi Mark,

The invalid id causes validation problems (XHTML 1.1 @ validator.w3.org).

My first idea was to give consistency to this kind of label: clicking on it would put keyboard focus on the select element. Now I noticed that this doesn't happen in any popular web browser.

Removing the "for" attribute would require the label to wrap the select element, which cannot wrap <div class="qfelement"> because that would mean a new lot of validation errors. My guess is that it would require some css and/or <div> rework to validate the page.

Thank you for your attention.

--
Eduardo Marinho

[2006-08-24 16:19 UTC] eduardo593734256 at gmail dot com

Hi Mark,

I don't think it's YOUR bad english. :-)

I'll say it in HTML:

Início:


00
23
:
00
55

Citing :

for = idref [CS]
This attribute explicitly associates the label being defined with another control. When present, the value of this attribute must be the same as the value of the id attribute of some other control in the same document. When absent, the label being defined is associated with the element's contents.

Início:


00
23
:
00
55

Início:


00
23


:

00
55

Início:

00
23


:

00
55

Since we can't call the whole group a single element and give it a "for", the only other solution
would be to add a "for" pointing to the first select element.

But validation also complains about "[" in "inicio[H]" in the id, so you could change it to just "inicio", for example:

Início:


00
23
:
00
55

Thank you for reading.

--
Eduardo Marinho