HTML Textarea

They have: 330 posts

Joined: Apr 2000

In a bulleting board style of textarea how do you keep the formatting consistant with the user's input? When using this UBB if I click enter

the text starts a few lines down. What would cause that to stay in the same format in a database?

Would I use

 tags before and after each textarea so next time it's displayed it's done the same way? 
Busy's picture

He has: 6,151 posts

Joined: May 2001

I'm only guessing here, but I'd say the code (php) uses \n (newline) for carriage returns (enter)

enter = br

If you use the pre tag it changes font style and size, you can use a font tag around it but isnt always the same result.

They have: 330 posts

Joined: Apr 2000

a carriage return is Chr(13) in ASP. Do you have idea how I would apply that to a textarea?

Thanks.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi artsapimp,

if I remember my ascii code correctly:

\n = charCode 13
\r = charCode 10

some dbms use both, so "\n\r" (or vice versa)

Vinny

They have: 330 posts

Joined: Apr 2000

yes, thank you.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.