Reply to Re: need help w/ outputting to a textarea

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация