Re: QuickForms textarea setting default value and cols rows
| From: | Justin Patrin | Date: | Mon, 14 Mar 2005 19:38:43 +0000 |
| Subject: | Re: QuickForms textarea setting default value and cols rows | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18059@lists.php.net to get a copy of this message | ||
On Mon, 14 Mar 2005 11:29:45 -0800, Mark Steudel <msteudel@panicware.com> wrote:
> I have another question on quickforms
>
> TextArea
> How does one set what is displayed in the textarea. I can set the value for
> it, by using the setDefaults('comments'+> $value);, but not sure how to set
> what shows up (e.g. <textarea>This is what I want to set</textrea>)
setDefaults should set what's in the textarea just fine. Have you tried it?
>
> cols and rows:
>
> I don't understand how to use the setCols() and setRows() functions to setup
> the columns and rows for a textarea element.
>
setCols and setRows lets you set the size of the textarea.
$el = HTML_QuickForm::createElement('textarea', 'comments');
$el->setRows(5);
$el->setCols(50);
Then add it to your form.
This should also work:
$el->updateAttributes(array('rows' => 5, 'cols' => 50));
--
Justin Patrin