|
Posted by NC on 10/14/28 11:46
Jeff Brady wrote:
>
> My problem is with trying to print the data to a textarea
> (on a form, so the data can be edited)
....
> <textarea name="LinkText" cols="100" rows="50" id="LinkText"
> value="<? print $data[body]?>"></textarea>
....
>
> any rules or weirdness I'm not aware of when printing field
> contents to textareas?
Yes. The text inside textarea should be output between <textarea> and
</textarea>, not in the "value" attribute of the <textarea> tag.
Change the line quoted above to this:
<textarea name="LinkText" cols="100" rows="50"
id="LinkText"><? print $data['body']; ?></textarea>
Also note (although it is not related to the matter at hand) that
indexes of associative arrays should be quoted (e.g., $data['body'],
not $data[body]). The latter syntax works for now (when PHP encounters
$data[body], it automatically defines a constant whose name and value
are the same), but can become deprecated at any time without a warning.
Cheers,
NC
[Back to original message]
|