Legacy Knowledge Base
Published Jun. 30, 2025

Is it possible to implement branching paths using Liferay Forms where one path does not require form submission?

Written By

Michael Tran

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

Issue

  • In some use cases, it may be desired for a form to branch into a path that does not require a form submission, based on the user's selection 
    • For example: If a user has submitted form in the past, they may not need to resubmit again
  • Is this behavior possible through out-of-the-box forms and form rules?

 

Environment

  • Liferay 7.4

 

Resolution

NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.

  • Currently, it is not possible to create a form path that does not require submission using out-of-the-box functionality
  • However, this behavior may be accomplished by leveraging Liferay fragments that enables a selection that will redirect--appropriate to the selection
  • Below is an example HTML fragment that demonstrates the following logic:
    • Page A -> Yes/No "form" selection (note: it is not a real form)
      • No, will "jump" to page C (in this case, page are not Form pages but layouts).
      • Yes, will "jump" to page B
    • Page B -> Information
    • Page C -> Form
        • NOTE: In this page, it may be beneficial to put some text before submitting: 'If you send this form you confirm "No" for the question ...."  in case the user finds the form directly with the URL 
    • Example HTML code:
    • <select id="option" onchange="handleOptionChange()">
      <option value="">Select an option</option>
      <option value="yes">Yes</option>
      <option value="no">No</option>
      </select>


      <a id="infoLink" href="/pageB" style="display: none;"></a>
      <a id="formLink" href="/pageC" style="display: none;"></a>

      <script type="">
      function handleOptionChange() {
      const selectedOption = document.getElementById("option").value;
      const infoLink = document.getElementById("infoLink");
      const formLink = document.getElementById("formLink");

      if (selectedOption === "yes") {
      infoLink.click();
      } else if (selectedOption === "no") {
      formLink.click();
      }
      }
      </script>



Additional Information

 

 

 

 

Did this article resolve your issue ?

Legacy Knowledge Base