The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Formidable stripping HTML tags
Hi, I'm having a bit of trouble accepting HTML code as entries. I've tried text, richtext and paragraph, and all of them actively strip out all html markup from the entry.
Is this an option somewhere? I can't figure out how to turn this off.
Cheers
Lachlan
January 30, 2019 at 7:31 am
I've been testing this in my local dev environment and used a rich text field. Rich text fields use the classic TinyMCE editor. The HTML is not being stripped from the content.
When using the Rich Text field, Formidable saves the content of the field as a linked post. If you use PHPMyAdmin, you can find the linked post in the wp_posts table instead of the standard Formidable tables. Check this for yourself, if the value of the post content contains the HTML, then Formidable is not stripping the HTML.
You will not see the HTML in the field if you look at the entry in the back end unless you view the page's source code. The reason why is that it's HTML and being treated as such when the form displays. It's being executed. Try adding a class to the field that turns the text part of the content to a different color and you'll see this work.
The same holds true if you display the contents in a view.
To see the HTML again, you either have to edit the form, make sure you are using the text tab in the rich text field editor, or edit the associated post. If you are on WordPress 5 and Gutenberg, the associated post content (the rich text field), opens in a classic editor block. Formidable is not saving post content as Gutenberg blocks yet. Ideally, this type of content should be saved as a custom HTML block.
WordPress has a long standing habit of stripping HTML from content that doesn't adhere to its definition of safe content. You can turn this feature off in Formidable by adding add_filter( 'frm_use_wpautop', '__return_false' ); to your theme's functions.php file. If you check your field content the way I suggested above, and you find the HTML is truly being stripped, add this to functions.php anyway. It may help. If not, then I'm out of suggestions except to look for plugin conflicts. If all fails, please open a support ticket with the Formidable team unless one of the other community volunteers here has a better idea.
January 31, 2019 at 4:04 am
Thanks a bunch! I'll give these suggestions a go and post back here!
Discussion closed.