PDA

View Full Version : Changing Textarea display


florida
05-12-2004, 05:29 PM
Please advise how I can handle Textarea entries on the client side where if sometone types in an entry and hits enter to enter new data it would show up on different lines on my action page.

For example in my Form Textarea with a field called city:
The user would enter several cities in the form textbox like this:

San Francisco
San Diego
Denver


My form would then process this and show on my action page as:

San Francisco San Diego Denver

I want it to show with newlines on my action page just as it was entered in the textbox:

San Francisco
San Diego
Denver

Here is my Textarea on the page:
<TEXTAREA name="city" ROWS="4"></TEXTAREA>

Can I do this with JavaScript?

Roy Sinclair
05-12-2004, 06:46 PM
You seem to indicate that you're posting this data to a script on a server somewhere and that server is echoing that input back to a response page.

If that's the case the server side script should be modified to turn all carriage return characters in the submitted form field into html line breaks (<br />). If you're working purely client side then your javascript code which fetches the data can make the same transformation.

canadianjameson
05-12-2004, 07:37 PM
i had the same problem, this is how i fixed it:

<pre><font face="Georgia, Times New Roman, Times, serif">{= param.Application_Information =}</font></pre>

using the <pre> tag fixed it for me

hope it helps you