Thomas Freeborough
Thomas Freeborough

Reputation: 26

Text in <textarea> automatically getting tabbed in

pretty new to Mysql, HTML and PHP and I can't seem to find much information on this trouble i'm having.

I Am making my own rough project manager type thing and I have a form that lets me change the contents of each individual change log, the problem I have however is that when I load the data in to the text area it start with a big indentation at the start, like 3-4 tabs inwards. I would attach an image but I need at least 10 rep to do that.

Basically, it feels like the data in the database has tabs or something at the start of it, but when I go to look in PHPmyadmin at the field, it just looks like it should do, not tabbed at all.

I've tried using strip_tags() but I think it only works on visible tags.

Does any1 know how to get rid of this or what is causing the problem?

I'll be following this question closely to see if anybody can provide an answer because I'm stumped.

Thanks,

Upvotes: 0

Views: 326

Answers (2)

Alban Pommeret
Alban Pommeret

Reputation: 327

Try to echo your php code with no blanks :

Possible tabs, bad example :

<textarea>
     <?php echo $tabContent; ?>
</textarea>

Avoiding tabs :

<textarea><?php echo $tabContent; ?></textarea>

You can also try to trim your php content like that :

<textarea><?php echo trim($tabContent); ?></textarea>

Upvotes: 1

Cr41s3
Cr41s3

Reputation: 97

Try doing var_dump and look how long your queried string is. If it is as long as in your database you problem is within the textarea. Is there any css you use with textarea?

Upvotes: 0

Related Questions