# Literal HTML textarea?



## aximbigfan (Apr 30, 2008)

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


----------



## magibeg (Apr 30, 2008)

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


----------



## aximbigfan (Apr 30, 2008)

magibeg said:


> try using this &amp;nbsp;
> 
> 
> It will display the & but not count it as code
> ...



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

Chris


----------



## magibeg (Apr 30, 2008)

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?


----------



## Kreij (Apr 30, 2008)

You can use 
	
	



```
<textarea>&#x26nbsp</textarea>
```

To display it.

What exactly are you trying to do?
I am not clear on your "can't change content" comment.


----------



## magibeg (Apr 30, 2008)

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?


----------



## aximbigfan (Apr 30, 2008)

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


----------



## Kreij (Apr 30, 2008)

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.


----------

