Dynamic adjustment of textarea

Results 1 to 5 of 5

Thread: Dynamic adjustment of textarea

  1. #1
    Join Date
    Dec 1969
    Posts
    119

    Default Dynamic adjustment of textarea

    Is there a way to adjust the size of text area dynamically so that as and when text keep coming in, it adjusts its length and width and no scrollbar appears?<BR><BR>Please help<BR>Arvind

  2. #2
    Join Date
    Dec 1969
    Posts
    147

    Default RE: Dynamic adjustment of textarea

    Arvind<BR><BR>I am working on exactly the same problem....I am search for an answer by looking for some sort of ASP command to change the font of an HTML file "on the Fly"..If I find one I will send it to you. If you find one please let me know...Ppatton@richmond.infi.net<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Dynamic adjustment of textarea

    Sure Phil<BR>I am also working on it and will definitely be in touch. Anyway thanks for response.<BR><BR>Arvind

  4. #4
    Joseph Hatcher Guest

    Default RE: Dynamic adjustment of textarea

    If you are using Internet Explorer for viewing try the following code to make the width adjustable<BR><BR>&#060;FIELDSET STYLE="width:90%; padding=10px; border:solid double yellow"><BR>&#060;LEGEND STYLE="color:yellow; font:20 bold;" ACESSKEY="n"><BR>&#060;FONT size=5>Narrative Information:&#060;/FONT><BR>&#060;/LEGEND><BR>&#060;form id=form2 name=form2><BR>&#060;TEXTAREA rows=4 cols=70 wrap=virtual id=textarea1 name=textarea1 style="width:90%" readonly onfocus="this.blur()"><BR>Text goes here <BR>&#060;/TEXTAREA><BR>&#060;/form><BR>&#060;/FIELDSET><BR><BR><BR>This does NOT work in Netscape. Also it does not adjust the height. If you find an answer let me know :)


  5. #5
    Brian O'Malley Guest

    Default RE: Dynamic adjustment of textarea

    I wrote this function to dynamically count, display and limit the number of charachters typed into a textarea. This updates a counter, but you could easily have the script update the width and height of the textarea.<BR><BR>These will capture the events and pass them to the function defined below. Setting the wrap to virtual takes care of the scrollbar showing or not showing so you don&#039t need to worry about that one.<BR><BR>&#060;textarea cols="12" rows="10" WRAP="VIRTUAL" ALIGN="BOTTOM" MAXLENGTH="500" onFocus="Update(this, 500)" onKeydown="Update(this, 500)" onKeyup="Update(this, 500)" onBlur="Update(this, 500)" NAME="UserInput"> <BR><BR><BR> function Update(Target, Max) <BR> {<BR> String_Length = Target.value.length<BR> if ( String_Length > Max )<BR> {<BR> Target.value = Target.value.substring(0,Max)<BR> CharsLeft = 0<BR> }<BR> else {<BR> CharsLeft = Max - String_Length<BR> }<BR> document.thisForm.CharsLeft.value = CharsLeft <BR> }<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •