Currently, I am developing a new internal sales application for the company where I am employed. One of the features is a form that enables users to update their delivery address.
I believe it would greatly enhance the user experience if the textarea used for entering the main address details dynamically resized based on the text input.
Any suggestions or solutions? Thank you!
Edit by XeeMez: Recently made some modifications to the code as it was not functioning correctly. Changed it to trigger on keyup event to account for each character typed.
resizeIt = function( ) {
var str = $( 'iso_address' ).value;
var cols = $( 'iso_address' ).cols;
var linecount = 0;
$A( str.split( "\n" ) ).each( function( l ) {
linecount += 1 + Math.floor( l.length / cols ); // consider long lines
} )
$( 'iso_address' ).rows = linecount;
};