Skip to content Skip to sidebar Skip to footer

Allow Html To Be Submitted From Textarea Input?

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: &

Solution 1:

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.

Solution 2:

Textarea accepts any text to be stored in TEXT, VARCHAR etc. field in database. To see HTML formatted text use "html_entity_decode" in php.

For example to HTML format WP descripton:

In database - in wp_options table change 'option_value' field from VARCHAR to TEXT

In header change:

<h2class="site-description"><?php bloginfo( 'description' ); ?></h2>

to

<h2class="site-description"><?phpecho html_entity_decode(get_bloginfo('description')); ?></h2>

In admin you can change

<td><textareaname="blogdescription"type="textarea"id="blogdescription"class="regular-text"cols="67"rows="7" /><?php form_option('blogdescription'); ?>"</textarea>

Now the 'textarea' stores all text you entered including HTML tags and you can see formatted text on your Blog header

Hope I got your point and it helps

Solution 3:

If you are using ejs you can format your tag like: <%- ... %> rather than <%= ... %>.

Post a Comment for "Allow Html To Be Submitted From Textarea Input?"