The project uses the HTML control of multi-line text such as textarea multiple times. You need to master the following features to use the control on the Web Front-end.
1. Cols -- number of columns in multiple input fields
2. Rows -- number of rows in multiple input fields
Note: Cols: vertical column. If no style sheet is set, it indicates the number of bytes that a row can accommodate. For example, cols = 80 indicates that a row can contain up to 40 Chinese characters. The same applies to rows.
3. The wrap attribute defines the display mode when the input content is greater than the text field. The optional values are as follows:
- The default value is automatic text line feed. When the input content exceeds the right boundary of the text field, it is automatically transferred to the next line. line breaks are not generated when the data is submitted for processing;
- Off to avoid text wrapping. When the input content exceeds the right boundary of the text field, the text will scroll left. You must use return to move the insertion point to the next line;
- Virtual, allows text to wrap automatically. When the input content exceeds the right boundary of the text field, it is automatically transferred to the next line, and there is no line break where the data is automatically wrapped when it is submitted;
- Physical allows text wrapping. line breaks are also submitted when data is submitted for processing.
4. Style = "overflow: hidden" (including overflow-X: hidden and overflow-y)
HideTextarea(Horizontal and vertical)
6. textarea does not have the value attribute (innerhtml)
< Textarea Name = "Mutlietext" Cols = "50" Rows = "5" Disabled > Charles </ Textarea >
7. display the input length of the multi-line text box.
Setting the maximum length with the maxlength attribute does not work. It must be set using a script.
Function Setmaxlength (control, maxlength)
{
Control. attachevent ( " Onkeypress " , Function (){ If (TRIM (control. Value). Length > = Maxlength) Return False ;});
Control. attachevent ( " Onpropertychange " , Function (){ If (Control. value. Length > Maxlength) control. Value = Control. value. substring ( 0 , Maxlength );});
}
Call:
< Script Type = " Text/JavaScript " >
Setmaxlength (OBJ, 500 );
< / SCRIPT>
Note about the textarea control for the moment. In the future, I will continue to add some other things about the control.