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
    Commented Aug 23, 2018 at 16:14
  • @Sharky in order to allow users to modify the form code, like adding a CSS class for example. Commented Aug 24, 2018 at 8:51

1 Answer 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. Commented Aug 24, 2018 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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