To prepare text fields that may contain carriage returns for use in <textarea> portions of a form, place them inside an [Input] context. Certain characters, such as carriage returns, are converted to "soft-returns" when they are saved in a database file. The [Input] context converts them back to "hard-returns" so they look right when displayed inside <textarea> tags. Other characters, such as "<" and ">" cause the <textarea> tag to get confused, so they are converted to "<" and ">" in order to display properly.
Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
This context is most often used when you create a form allowing visitors to edit (replace a record) with large portions of text in a database field that has carriage returns in it. If you do not use this context, then the lines of text inside the <textarea> multiline input field will appear to have "lost" all the carriage returns that were originally there. This is because web browsers do not understand how to display a "soft-return" character, so it appears as a simple space instead.
Here is a list of exactly what happens to text when it is put inside an [Input] context:
If the character is...
|
then it is translated to...
|
---|---|
Soft-return (%0B) | Hard-return (%0D) |
< | < |
> | > |
& | & |
" | " |
Any other character | no change |