Sep 4

Written by: Dylan Barber
9/4/2009 1:29 AM  RssIcon

The website I work on as a fulltime developer has some unique challenges. Besides covering over 10 languages for both content and UI we have a lot of text areas where users can describe and enter various bits of free form data. We provide reports for the information but for some reason unknown to me lots of our users print out the form with all the text areas they filled in as a ‘report’. This was never intended so the first request to make the text area larger so all the typed in info would print sort of struck me as strange, why not print the report that shows all the info? Well as any developer can tell you it doesn't matter if the problem is the programming or not its your problem!

I set out to fix this with jQuery since I did not want to go back and revise 62 data entry pages! jQuery.com had a few plugins that I was never able to make the work the way I wanted. One of the problems with the plug-in I first used was that they required the user to click in the text area to activate the function and expand to the size of the text. Typing into the text area worked great but when a user pulled up a saved record they had to click in all the text areas to ‘size’ them for printing. I finally came across this article on Sitepoint.com for an auto expanding text area, http://www.sitepoint.com/blogs/2009/07/29/build-auto-expanding-textarea-1/.  The plug-in not only expands correctly it a few optional parameters for the function to keep pages from becoming to large or shrinking too small.

I had to search a long time to find this and wanted to post it on my blog here so others may have an easier time finding this script.


Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel