Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow HTML to be submitted from textarea input?

Tags:

html

textarea

How do I allow HTML to be submitted from textarea, I am really desparate on this, every answer I found gives me poor info, coz I don't have idea what to do.

I have this textarea:

<input id="mytextarea" name="mytextarea" type="text" value="" placeholder="<?php _e('iframe'); ?>">

or:

<textarea id="mytextarea" name="mytextarea" type="text" placeholder="<?php _e('iframe'); ?>"></textarea>

I want HTML to stay as it is after submission, in my case html is removed.

like image 659
Polo Pakina Avatar asked Sep 17 '25 02:09

Polo Pakina


1 Answers

The HTML tag only accepts plain (unformatted) text. Even if you add HTML to it, or try to format it, it will be removed. What you need to do is use a Rich Text Editor. There are many you can use, for example CKEditor and TinyMCE. You can use these editors in HTML mode (source code mode) and do what you’re trying to do.

like image 198
Yushell Avatar answered Sep 19 '25 17:09

Yushell