Quickform: Group of hidden fields
| From: | pt2002 | Date: | Thu, 09 Dec 2004 11:37:24 +0000 |
| Subject: | Quickform: Group of hidden fields | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16139@lists.php.net to get a copy of this message | ||
Hi
Thanks to the help of this list I could do what I need to take an older
application to use smarty & html_quickform.
In the application, there are some forms that read data form a db and edit
that records in a 'grid'.
So far so good. I create a group, validation rules and display and edit
them. To display the form I use smarty section tag. For each record there is
one row in a table.
Now I need to have a hidden field for each record.
I create a group the same way for the others fields. I know there's
something wrong because they are not in the html.
for ($i=0; $i<count($list); $i++) {
$values[] = &HTML_QuickForm::createElement('text', $i, '',
'');
$hiddTest[] = &HTML_QuickForm::createElement('hidden', $i, '12345');
//
$valueRules[$i][] = array('Must be a number', 'numeric', '',
'client');
}
$form->addGroup($values, 'values', '', '');
$form->addGroup($hiddTest, 'hiddTest', '', '');
In the template I had tried
{$form_data.hidden}
Inside the section: {$form_data.hiddTest.n} n=0...record count
but none work.
If I create just one hidden field it's ok.
Greetings