Legacy Knowledge Base
Published Jul. 2, 2025

Known Issue: <form> tag is removed in Alloy Editor

Written By

Alfonso Crisci

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

This article describes a known limitation visible in the Alloy Editor as documented in LPS-71067.

When using the editor's source mode and entering a <form> tag, the editor will remove it upon switching back to Alloy Editor's WYSIWYG or publishing the content.

Root Cause

The root cause of this issue is that, as indicated in the HTML specification at https://www.w3.org/TR/html4/interact/forms.html#h-17.3, a <form> tag cannot be nested inside another one. Because Liferay DXP is attempting to do this, the browser itself will filter the tag out.

The Alloy Editor works in "inline" mode and is itself wrapped inside a <form> tag in the page. This will lead the browser to "fix" the HTML and strip down the "extra" <form> tag.

Resolution

Status: Workaround Available

To work around the limitation, you may switch from Alloy Editor to CKEditor by setting

editor.wysiwyg.portal-impl.portlet.ddm.text_html.ftl=ckeditor

in the portal-ext.properties file of the affected Liferay instance.

Although the unwanted behavior is rooted at browser level, CKEditor on DXP operates in "iframe" mode, therefore the issue will not be triggered.

Additional Information

CKEditor and Alloy Editor are provided as WYSIWYG Content Editors and are not intended to be HTML Editors. These editors' Source Modes are provided for convenience and are only intended for minor markup adjustments. Any markup entered into Source Mode is not guaranteed to remain unmodified nor intact.

Resolving this known issue on Alloy Editor at the root should imply modifying the embedding architecture of Alloy Editor in DXP. As an API-breaking change, in order to preserve the stability of the Liferay General Availability releases, the new potential solution may only appear in future Liferay versions

Liferay Front-end engineering is aware of the issue and will take it into consideration when working in future Liferay implementations. Please see the New Feature Implementation article for all details.

Did this article resolve your issue ?

Legacy Knowledge Base