Expand multi-line textbox

runswithsizzors

Well-known member
Joined
May 11, 2005
Messages
70
Location
Northern Michigan
Programming Experience
5-10
Hey I have a situation where a comment box needs to expand instead of scroll. Is there any way to do that on a web form?

Thank you to all that reply!
 
This is what I ended up doing but does anyone know how to make this work with a text box. This is for textarea. Thanks!

VB.NET:
            function resizeCommentsBox(sender)
            {   
                a = sender.value.split('\n');
                b = 1;
                for (x = 0;x < a.length; x++) 
                {
                    if (a[x].length >= sender.cols) 
                    {
                        b += Math.floor(a[x].length/sender.cols);
                    }
                }
                b += a.length;
                if (b > sender.rows)
                {
                     sender.rows = b;
                }
            }
 
Back
Top