Followup Q to HTML_QuickForm With Arrays as Text Elements?
| From: | James 'Chip' Kaufman | Date: | Wed, 05 Nov 2003 16:50:40 +0000 |
| Subject: | Followup Q to HTML_QuickForm With Arrays as Text Elements? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8778@lists.php.net to get a copy of this message | ||
If I set up my form like this (recommended by Bernard Mansion):
$form->addElement ('text', "reqdate[0]", 'Req. Start',
array('size'=>'10'));
It looks ok in a QuickForm dump:
[11] => html_quickform_text Object
(
[_attributes] => Array
(
[size] => 10
[name] => reqdate[0]
[type] => text
[value] => 07/17/2003
)
[_tabOffset] => 0
[_tab] =>
[_lineEnd] =>
[_comment] =>
[_label] => Req. Start
[_type] => text
[_flagFrozen] =>
[_persistantFreeze] => 1
)
However, I'm using the ArraySmarty renderer, and the smarty dump looks
like:
[0] => Array
(
[name] => reqdate[0]
[value] => 07/17/2003
[type] => text
[frozen] =>
[label] => Req. Start
[required] =>
[error] =>
[html] =>
)
Notice that the array key changed from 'reqdate[0]' to '[0]'. Is this
another array_merge glitch? Some obvious fix?
--
James 'Chip' Kaufman
jkaufman@wamnetgov.com
952-346-3532
PGP key: 697D43DE