|  | Posted by Jeff Brady on 06/14/02 11:46 
NC wrote:> 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
 
 That was exactly it .. thanks! Apparently I forgot my basic HTML skills
 somewhere along the way. =)
 
 I also took your advice about the quotes. Thanks again!
 
 Jeff
 [Back to original message] |