PEAR is archived and read-only

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

Home » HTML » HTML_QuickForm2 » Bug #5128

html attribute access to labels

Details

Request #5128html attribute access to labels
Submitted2005-08-17 18:32 UTC
Froms dot schwardt at ispeicher dot de
StatusWont fix
PackageHTML_QuickForm2
PHP Version5.0.4
OSLin
Roadmaps(Not assigned)

Comments

[2005-08-17 18:32 UTC] s dot schwardt at ispeicher dot de

Description:
------------
As IE isn't able to address certain elements specified by their attribute a xhtml dev has the following problem:

$form->addElement('radio', 'dummyn', null, 'dummyo', 'dummyv');

creates
"
<label></label>
<input name="dummyn" value="dummyv" type="radio" id="qf_a0ef98" />
<label for="qf_a0ef98">dummyo</label>
"

using css to format the labels like
"
label { float: left; display: block; width: 20em; }
"

will IE-result in

[ ][( )dummyo ]

The IE isn't able (yet and might never be...) to distinguish between the prefix-<label> and the radio-for-label using
"label[for]".

This is really annoying. Being able to access the attributes of the label-for would solve this problem. By now I extended the lable-creation in _radio and _checkbox to
"
$label = '<label for="' . $this->getAttribute('id') . '" class="IEradiolabel">' . $this->_text . '</label>';
"
which makes it for me as a workaround.