PEAR is archived and read-only

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

Home » Database » DB_Table » Bug #4614

radios do not line up

Details

Submitted2005-06-16 20:19 UTC
Fromjameslee at cs dot nmt dot edu
Assignedpmjones
StatusClosed
PackageDB_Table
PHP Version4.3.11
Roadmaps(Not assigned)

Comments

[2005-06-16 20:19 UTC] jameslee at cs dot nmt dot edu

Description:
------------
When creating a column of type 'radio', DB_Table adds both a <br /> and a   between each radio button, causing them not to line up.

The simplest way to fix this would be to change line 415 of QuickForm.php from:
$btnlabel . '<br />',
to:
$btnlabel,

It might also be desirable to have a 'qf_seperator' (or similar) that is added as the fourth parameter to addGroup on line 210 of QuickForm.php

(Using version 1.0.1 stable)

Reproduce code:
---------------
$col = array(
// ...
'Site' => array(
'type' => 'integer',
'qf_type' => 'radio',
'qf_vals' => array(
'0' => 'on',
'1' => 'off',
),
),
);

[2005-06-19 19:33 UTC] post at mark-wiesemann dot de

Please do not remove the '<br />' - this is very useful for longer labels.

But this is really a bug, I have since months the following line in the function that outputs my forms:
$html = str_replace('<br /></label> ', '</label><br />', $html);
Don't know why I haven't submitted that as a bug.

The suggested solution to use 'qf_seperator' (default if not set should be: '<br />') is very nice. Maybe you could also add a new parameter to getForm() function (same default value) that will be overridden for single elements if 'qf_seperator' is specified in the elements config array.