Solved

how to make a text box/text area expandable but not scrollable

Posted on 2008-10-03
5
910 Views
Last Modified: 2013-11-19
hi,

our clients wants a comment box that automatically expands vertically as the existing box becomes full, but they don't want scrolling.  is this possible?
0
Comment
Question by:mmingfeilam
  • 2
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 250 total points
ID: 22638856
"is this possible?"

Simply, NO.  You have to specify a width and a height for a text box area, and that is fixed.  But look at RICH TEXT AREA -- it might be able to do what you want, you will have to see, the normal text area cannot do it

www.textarearich.com/
www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm
www.tcpiq.com/tcpIQ/HTMLRichTextArea/
www.topshareware.com/HTML-Rich-Text-Area-download-1456.htm
0
 

Author Comment

by:mmingfeilam
ID: 22639897
is there any that runs on the server side that allows you to save the format (somehow) to the database along with the content?
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 250 total points
ID: 22639902
I do not have one at my disposal but
1. capture input when focussing on existing textbox/hide textbox, show div
2. output keystrokes to div and save in hidden textbox
0
 

Author Comment

by:mmingfeilam
ID: 22888225
mplungjan: can you give me a simple example?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22892952
Something like this
<script>
function captureIt(cap,field) {
  if (cap) {
    field.style.display='none'
    document.getElementById('output').style.display='';
    document.onkeydown=function(e){
      e=(e)?e:event;
      if(!e)return 0;
      field.value+=String.fromCharCode(e.keyCode);
      document.getElementById('output').innerHTML=field.value
    }
  }
  else document.onkeydown=null;
}  
</script>
 
<input type="text" onFocus="captureIt(true,this)">
<span id="output" style="display:none"></span>

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question