<textarea>& nbsp ;</textarea>

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Alright, how can I stop textareas from converting & nbsp ; to a space?
 

aloser

Senior member
Nov 20, 2004
511
1
81
& nbsp ; means "space" in html - just like "Hallo" means "Hello" in German (oder Detusch...)
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: aloser
& nbsp ; means "space" in html - just like "Hallo" means "Hello" in German (oder Detusch...)

Uh, no kidding.
It actually means "non-breaking space" to be exact.

Textareas, for some reason, leave all other HTML in there like < >, however any special character code will be converted to it's rendered counterpart. & gt; becomes >, & lt; becomes <, etc.
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Alright, so the only thing I can do, is before I write the code into the text area... I've gotta modify it and chance all the stuff... great
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: Modeps
Alright, so the only thing I can do, is before I write the code into the text area... I've gotta modify it and chance all the stuff... great

I'm just curious.. why are you doing this? Are you writing some kinda tutorial?
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: screw3d
Originally posted by: Modeps
Alright, so the only thing I can do, is before I write the code into the text area... I've gotta modify it and chance all the stuff... great

I'm just curious.. why are you doing this? Are you writing some kinda tutorial?

It's for a backend interface to modify webpage code.
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: BingBongWongFooey
Chance what? It just needs an extra layer of escaping.

edit: nm, pretty sure you mean change

yeah I meant change
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
The simplest answer is always the correct one. Just before writing the code that appears inside the <textarea> tags, all I had to do was replace all the & with & amp;'s. It renders properly in the textarea, and is inputted correctly into the database.

Thanks blokes.

~M
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Just out of curiosity, is this php?

Any time you're dealing with any web page where the user can input data you need to have escaping code handy. What if the person happened to type something like this?:

</textarea><script>window.close()</script>

I know that's a contrived example and the user would have to be malicious to do it, but take a look in Forum Issues some time and see how many people can't edit their profiles correctly. If I'm not mistaken, it's usually because they did something that screwed up a textarea on the profile page.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |