Re: QuickForm issue
| From: | Bertrand Mansion | Date: | Mon, 17 Jun 2002 14:29:03 +0000 |
| Subject: | Re: QuickForm issue | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1689@lists.php.net to get a copy of this message | ||
<david@ddahl.com> wrote :
> Well, i looked at both of the setConstants and setDefaults methods... so
> I put this in my code:
>
> $userFormEdit->addElement('text', 'namel', 'Last Name');
> $userFormEdit->setConstants(array ('namel' => $row['namel']));
>
>
> and i tried it like this:
>
> $formConstantsEdit = array('namel' => $row['namel']);
> $userFormEdit->addElement('text', 'namel', 'Last Name');
> $userFormEdit->setConstants($formConstantsEdit);
>
> both output the form like this:
>
> <tr>
> <td align="right" valign="top"><b>Last
> Name</b></td>
> <td nowrap="nowrap" valign="top" align="left"><input
> name="namel"
> type="text" /></td>
> </tr>
>
> Can you spell it out for me?
Just set the values before adding the elements. Prepare an array with all
the values you need for all the elements you need, then setDefaults or
setConstants with this array, then addElement. It is just an habit to have
to handle the raw data first.
Good luck,
Bertrand Mansion
Mamasam