Solved

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

Posted on 2008-10-03
5
908 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
HTML page and JavaScript 2 54
Safari SVG Image Problem 1 20
Modify Table Width 6 14
Test ddwrt:UserLookup 1 23
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now