Hidden Field

The Hidden Field is a standard HTML input element that is hidden from the user, unlike the Text Field. It is typically used to pass or set temporary or session-based information.

How does it work?

To see how the Hidden Field works, use the built-in App Expenses Claims. Follow these steps:

  1. Start the Joget Server and open the App Center.
  2. Log in as admin and click the pencil icon on the Expenses Claim to open the App Composer.
  3. Under the Form Builder column, click Expense Claim New.
  4. Click the Hidden Field element entitled status to open up the Configure Hidden Field properties.
  5. Click Preview, and you will not be able to see the Hidden Field.

Configure hidden field

Configuring the Hidden Field involves setting the ID, default value, and advanced options to ensure the element behaves as expected and captures the necessary data.

Fields to configure:

  • ID: Element ID. By declaring it as status, a corresponding database table column c_status will be created. See Form Element for more information about defining the ID and a list of reserved IDs.
  • Default Value: The value is displayed if no other value is selected or entered. Hash variables are accepted here. For example, #currentUser.firstName# #currentUser.lastName# to pre-populate the field with the currently logged-in user's name.

Advanced options

Advanced options provide additional settings for data handling, validation, and workflow integration, enhancing the functionality of the Hidden Field.

Data

Data settings in advanced options help prioritize data sources and ensure input validation.

Fields to configure: 

  • Data Priority: Determines which value to be taken into consideration. There are 3 options with data precedence to cater to different use cases.
  • Validator: Attach a Validator plugin to validate the input value. See Form Validator.
    When will validation take place?
    Validation will take place whenever a form is submitted except when it is submitted as Save as Draft.
    Available options include:
    • Basic
    • BeanShell
    • Date and Time Duplicate Validator
    • Directory
    • Duplicate Value
    • Equal Value
    • Multi Form Validator
    • Password
    • Plugin Template - Validator

Workflow

Workflow settings in advanced options integrate form elements into workflow processes, ensuring that data is captured and utilized effectively within a process.

Field to configure:

  • Workflow Variable: If the form is part of a workflow process, upon saving the form by clicking Save as Draft or Complete, the value in this input field will be saved into the corresponding workflow variable named  in this field.

Using a non-existent Workflow Variable name
You will get a warning with the name printed out (e.g., status) in the server log if you attempt to map to a non-existent Workflow Variable.
context attribute status does not exist in process context - adding new attributes to the process context is not allowed
Created by Julieth Last modified by Aadrian on Dec 13, 2024