• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Literal HTML textarea?

aximbigfan

New Member
Joined
Oct 15, 2006
Messages
847 (0.12/day)
Location
St. Louis, MO
System Name QUAD1
Processor Intel Core i7 920
Motherboard Asus P6T SE
Cooling XIGMATEK HDT-S963
Memory OCZ 3 X 1GB Triple Channel
Video Card(s) HIS Radeon HD4670 IceQ
Storage Seagate 250GB 7200RPM SATA
Display(s) Acer AL1916W 19" Widescreen LCD
Case CM Storm Scout
Audio Device(s) Onboard
Power Supply Corsair 520 Watt
Software Windows XP Pro
I have an HTML form, where there is a textarea. The problem, is that say I have this:
<textarea>&nbsp;</textarea>

It doesn't show the TEXT for &nbsp;, it shows a space. Is there any way I have have it where what ever is in between the tags is shown literally? Or, is there another HTML tag that does this?

Thanks,
Chris
 
try using this &amp;nbsp;


It will display the & but not count it as code :)



edit: to be more specific by using &amp; it will display the & symbol and then the next section just counts as a visible nbsp;

so when the 2 are combined on the screen they are &nbsp; while in the code they count as 2 seperate parts
 
try using this &amp;nbsp;


It will display the & but not count it as code :)



edit: to be more specific by using &amp; it will display the & symbol and then the next section just counts as a visible nbsp;

so when the 2 are combined on the screen they are &nbsp; while in the code they count as 2 seperate parts

The problem is that I can't modify the contents of the area.

Chris
 
Unfortunately you may be out of luck then and limited by html. Because of the way its designed the only way you can really do it is to trick it by splitting it into separate symbols. I suppose theres no way in this case to try to output a php line is there?
 
You can use
Code:
<textarea>&#x26nbsp</textarea>

To display it.

What exactly are you trying to do?
I am not clear on your "can't change content" comment.
 
Last edited:
Does that mean that you're looking for a specific type of text box that displays it? And you're not allowed to modify the default text inside the box?
 
This is a little hard to explain, but it is basically an experimental thing where it is retrieving text from a homemade database, an then showing it in the textarea, using PHP.

for example if it retrieves this: &nbsp; hello! From the database, the text cannot be modified at all, so nothing can be inserted or taken out because that is part of what I am experimenting with.

For example, when I post &nbsp; , it appears as text on the forums without the text being modified. I want to replicate that.

EDIT: what, TPU is appending a &amp.... Case closed...

Chris
 
You could parse the input from the database and look for special input (like &nbsp).
You could then have the parse script send a replace string (like &#x26nbsp) to the textarea.

If I am understanding you correctly.
 
Back
Top