Welcome to WebmasterWorld Guest from 54.145.39.186

Forum Moderators: incrediBILL

Message Too Old, No Replies

Help Needed - Text Area of dynamic size

     

mshahMCS

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

10+ Year Member



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.

Iguana

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

WebmasterWorld Senior Member 10+ Year Member



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.

mshahMCS

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

10+ Year Member



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.

Iguana

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

WebmasterWorld Senior Member 10+ Year Member



<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>

mshahMCS

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

10+ Year Member



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.

Iguana

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

WebmasterWorld Senior Member 10+ Year Member



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

Featured Threads

Hot Threads This Week

Hot Threads This Month