Return data with database formatting in a Textarea

Asked

Viewed 281 times

0

Good evening, I am saving the data in the database correctly, IE in the database is recorded:

<p style="text-align: center;"><strong>teste negrito</strong></p> <p><strong>teste testes</strong></p> <p>&nbsp;</p>

but when I try to inspect the data in its return to the textarea, this first line that is with style="text-align: center;", returns without this formatting, it returns only:

<p><strong>teste negrito</strong></p>

To bring the data I’m doing:

<textarea style="resize: none" name="campo" class="tiny form-control" rows="6"><?php echo ($retornoBanco);?></textarea>

I have already looked at numerous native PHP commands to bring this correct formatting and can’t, can anyone help me? Note: I am using Tinymce to generate the data with this formatting.

  • I did a test here and carry everything normal.

  • yes, if you try to play inside the textarea on "nail", it will show correctly, I did this test too, but when it comes from the bank the style="" formatting is not adhered to or does not come with the rest of the data.

  • What if playing inside a div works? The problem is the textarea? Or already comes from the bank without the style?

  • I think it’s some limitation of the textarea, but I wanted to see if there are any options I don’t know to continue using it in editing mode...

  • Um... thanks to your suggestion to try to use the code on a Div that I was able to understand where I was going wrong, I have a habit of sending the data using addslashes, and receiving them tbm, but in this case when receiving with addslashes he was reformatting the text, I just removed it to receive and the problem is solved!!! Thanks for the help!!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.