forum

Home / DeveloperSection / Forums / Multiline textbox auto height

Multiline textbox auto height

Manoj Bhatt322103-Sep-2013

I have multiple multiline textboxes that I fill from a database table. When typing in them the height auto-expands and adjusts in height to the # of rows of text being entered so all rows of text can be seen without scrolling. This is perfect, but when I re-load the page (after I save the textbox data back to the db) the multiline text boxes do not adjust back to the height they should be, showing all rows of data. I figured out a non elegant way to resize the textboxes accordingly. I find the # of characters in the entire multiline textbox, divide that # by the # of characters that can fit in the row based upon the width I've chosen to get the how many rows there should be, multiply that # by the pixel height of a row, and set the textbox height to this # in pixels. There has to be a more elegant way to do this but I can't find it. Anyone have any ideas?


Updated on 03-Sep-2013

Can you answer this question?


Answer

1 Answers

Liked By