Use JavaScript to dynamically assign text data in the database to textarea
Source: Internet
Author: User
I want to dynamically add text data to textarea, as shown below: Program Cannot be displayed normally
Shtform is form field, and txt_cmpnyprms is textarea
Response. Write ("<script language = 'javascript '> ")
Tempstr = "shtform. txt_cmpnyprms.innertext = '" + htmlencode (v_rs ("cmpny_prms"). getchunk (1000) + "';"
Response. Write (tempstr)
Response. Write ("</SCRIPT> ")
In Source code Shown as follows:
Shtform. txt_cmpnyprms.innertext = 'efg <br/>
<Br/>
S <br/>
Fdad <br/>
F <br/>
A <br/>
FDA <br/>
<Br/>
FAD ';
How can this problem be solved?
1st Floor
Response. Write ("<SCR" + "ept Language = 'javascript '> ");
Response. Write ("</scr" + "ept> ");
2nd floor
Is it htmlencode?
Third floor
To: SDTS (angel of God)
No. I added htmlencode later. When there is no htmlencode, the display format is as follows:
Shtform. txt_cmpnyprms.innertext = 'efg
Fdad
F
A
FDA
FAD ';
4th floor
Up
5th floor
Tempstr = "shtform. txt_cmpnyprms.innertext = Unescape ('" + escape (v_rs ("cmpny_prms"). getchunk (1000) + "')"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service