1

I have an editor field with some HTML code in it. The HTML code consists of a form and one of the form fields is a text area.

When this code is added to the editor field, the Admin section of the module breaks completely. I have no idea why. This isn't caused by any other HTML form fields other than textarea.

Why is this happening and how can it be solved?

Thank you.

  • May I ask why you're trying to add a form to an editor field? This doesn't sound like a common practice. – Sharky Aug 23 '18 at 16:14
  • @Sharky in order to allow users to modify the form code, like adding a CSS class for example. – Sergiu Tripon Aug 24 '18 at 8:51
1

Editor field is actually a <textarea> element with editor functionality added through JavaScript. So any HTML code inside it must be escaped. Without escaping, you end up with <textarea> element within <textarea> element which is invalid HTML.

  • How would I go about escaping the <textarea>? Thanks. – Sergiu Tripon Aug 24 '18 at 8:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.