Difference between revisions of "JavaScript - Increasing Rows in a Text Area"
From All n One's bxp software Wixi
Philip Lacey (talk | contribs) (Created page with "= Overview = A text area is a special type of HTML object which is used for capturing large amounts of text. The challenge is that there is limited space on a web page. Th...") |
Philip Lacey (talk | contribs) |
||
| Line 27: | Line 27: | ||
You change the strCDA_292_field_0_2 to whatever your text area is. | You change the strCDA_292_field_0_2 to whatever your text area is. | ||
| + | |||
| + | |||
| + | The default text area is 5 rows. When the cursor goes into the text area, the row count doubles to 10. When the cursor moves out to another field, the row count reduces back to 5. | ||
Revision as of 14:07, 3 September 2015
1 Overview
A text area is a special type of HTML object which is used for capturing large amounts of text. The challenge is that there is limited space on a web page. There is a very easy way to make space dynamically change using the following capability.
2 Setup
We start with a text area in form. In this example... "Description"
We are going to edit the questions, using the details from the very top of the page.
We add some JavaScript to the onFocus and the onBlur of the question.
document.getElementById("strCDA_292_field_0_2").rows = "10";
You change the strCDA_292_field_0_2 to whatever your text area is.
The default text area is 5 rows. When the cursor goes into the text area, the row count doubles to 10. When the cursor moves out to another field, the row count reduces back to 5.