PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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.