homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Help Needed - Text Area of dynamic size

 2:52 pm on Jul 30, 2003 (gmt 0)

I am getting a block of text from a database, and would like to display it. I want the users to be able to see that entire block of text without scrolling up or down. I am using text area right now because my text has newline characters on it "\n", and the textarea supports it. I want the textarea to change in size depending on how large the text is....is this possible?

If not, how do I display a large amount of text without users having to scroll (they can scroll the page up and down, just not the box). Remember that it needs to suppost the "\n" character.

Any help is appreciated.



 3:01 pm on Jul 30, 2003 (gmt 0)

I can't think of an easy way to it with a Textarea.

Your scripting language should be able to replace the '\n' with a <BR> eg. in VBScript sText=Replace(sText, chr(13), "<BR>") - or something close to that. Then you can use a DIV to display the text and it will set its height according to the length of the text.


 3:16 pm on Jul 30, 2003 (gmt 0)

Ive never really used CSS.

Could you just give the syntax I would use to display text?

I used Coldfusion to replace the \n with <BR>

How do I display it with <div> now?

Thanks for the help.


 3:22 pm on Jul 30, 2003 (gmt 0)

<DIV>text</DIV> just simple HTML (its just a block element - the css only comes into play when you start to use absolute positioning).

If you want to control the display of the text then try
<DIV style="font-size:x-small; background-color: cyan">text</DIV>


 3:26 pm on Jul 30, 2003 (gmt 0)

THis is how I am displaying it right now:

<cfset internal=Replace(internal,"\n","<BR>","all")> <DIV><cfoutput>#internal#</cfoutput></DIV>

And it doesnt show the \n or the <BR>...its just a jumble.


 4:11 pm on Jul 30, 2003 (gmt 0)

Sounds like the replace isn't working - maybe its looking for the string \n rather than the newline character.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved