wmac Posted February 14, 2010 Share Posted February 14, 2010 Hello I have a strange problem with textarea tag. When I load a string which contains encoded html into it, it decodes "encoded htmls" when showing the text. I want the encoded parts to remain encoded. (if I echo it normally and view the source of the page, the encoded html has remained encoded, while in textarea it is being shown decoded). Anyone can help? Thank you very much. <textarea cols=80 rows=20><p>We can use a background picture for web pages instead of background color. <BODY> tag in HTML code can be extended to include an image file name as the background of the page. Let's assume we have an "image1.gif" file and we want to use it as background. Image file must be in the same folder as our html file otherwise browser will not be able to find it. (Or you can add the file path to the image file name). </p> <p>Example 1-3: <span style='font-weight:normal'>page1-3.html</span></p> <p><HTML><br> <HEAD><br> <TITLE>My company web page</TITLE><br> </HEAD><br> <BODY BACKGROUND="image1.gif"><br> Welcome to our homepage. More text here.<br> </BODY><br> </HTML></p> <palign=center><br> <img width=438 height=321 src='images/image008.jpg'></p></textarea> - Please see the snapshot of the produced textarea here Link to comment https://forums.phpfreaks.com/topic/192035-problem-with-textarea-shows-encoded-htmls-in-decoded-form/ Share on other sites More sharing options...
yozyk Posted February 14, 2010 Share Posted February 14, 2010 Textarea is similar to the input tag. Inside the textarea there should be no other tags... Link to comment https://forums.phpfreaks.com/topic/192035-problem-with-textarea-shows-encoded-htmls-in-decoded-form/#findComment-1012134 Share on other sites More sharing options...
yozyk Posted February 14, 2010 Share Posted February 14, 2010 If you want block with scroling use div and css overfow: scroll Link to comment https://forums.phpfreaks.com/topic/192035-problem-with-textarea-shows-encoded-htmls-in-decoded-form/#findComment-1012136 Share on other sites More sharing options...
jl5501 Posted February 14, 2010 Share Posted February 14, 2010 yozyk, a textarea is used by a CMS system to enter html for other pages. Quite often hidden by the use of a wysiwyg editor, but does not need to be. Link to comment https://forums.phpfreaks.com/topic/192035-problem-with-textarea-shows-encoded-htmls-in-decoded-form/#findComment-1012139 Share on other sites More sharing options...
yozyk Posted February 14, 2010 Share Posted February 14, 2010 yozyk, a textarea is used by a CMS system to enter html for other pages. Quite often hidden by the use of a wysiwyg editor, but does not need to be. But inside the textarea only CDATA can be used. Link to comment https://forums.phpfreaks.com/topic/192035-problem-with-textarea-shows-encoded-htmls-in-decoded-form/#findComment-1012148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.