Re: QuickForm issue
| From: | David Dahl | Date: | Mon, 17 Jun 2002 14:14:37 +0000 |
| Subject: | Re: QuickForm issue | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1688@lists.php.net to get a copy of this message | ||
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?
Thanks!
David
On Monday, June 17, 2002, at 03:51 AM, Bertrand Mansion wrote:
Use setDefaults or setConstants to set values of your elements. BTW, you'd better use $row['name'] than $row[name]. You can set the value of hidden elements directly but this is only for practical reasons. Bertrand Mansion Mamasam