3 years, 3 months ago
Javascrpt: Show the whole text area when it get focus
On my webpage, there are a series of text areas containing data. They were originally set to be 2 rows but when a text area gets focus, I dynamically change it to 20 rows so the user can see more data. The problem is when the user gets close to the bottom of the screen, the text area expands, but only the first cuple rows are visible and the user needs to scroll down. Is there anyway to automatically "move up" the text area when it expands to make sure all rows are visible?
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$1 Answer
perhaps you could shift it up dynamically when you resize it?
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$
Well you said that you change it to 20 rows when it gets focus, you could at the same time move it up in the page so that all 20 rows are visible at once
What do you mean shift it up dynamcially?
The problem with that is if the textbox is already on the top of the screen, moving it up 20 rows will hide the top part.
Anyway, not sure if there can be a good solution for this...