Home > Web Front-end > JS Tutorial > Questions about script operation text fields_form effects

Questions about script operation text fields_form effects

WBOY
Release: 2016-05-16 19:14:30
Original
1190 people have browsed it

Using jsp servlert, after the content entered in the text box reaches the far right, the text content will automatically wrap
and when I save it to the database for display, I want to get the content that completely matches the entered form, but there is no way get.
That is, I can only find the hard carriage return but cannot recognize the content that automatically returns after the content is full.
I am now wondering if there is a way to get line-by-line reading content from the text field, similar to readline for reading text files
Which expert can help me and give me some suggestions
Text field The line breaks in are not displayed in the database, but they do exist
After reading the data, the display format in the text field is the original format and will not change
If you want to display it directly on the web page, you need str.replace("n" ,"
").replace(" ","& nbsp;")
But the text field will not automatically wrap and display

If you want the text field to be displayed intact, except for the above The steps are to use a div to put data, set the div width to be consistent with the text field, and then set the div auto-wrap attribute, and that’s it


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

Thank you very much, I will change it again It should be fine
I have another question to trouble you, that is, when there are full-width and half-width in the text field,
For example: dddddddddddd time and place dddddddddddddddd
At this time, its effect in the text field is
dddddddddddd place on time
dddddddddddddddd
Normal should be:
dddddddddddd place on time dddddddddddd
dddd I wonder if there is a way to avoid this problem. Does the text field have such an attribute to control whether it does not Will wrap like method 2
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template