Ticket Form
Advanced
Using the hidden field type

Ticket Form - Using the Hidden field type

First, make sure you have read and understood the previous section about intercepting the ticket form submission.

How it works

The Hidden field type is a special field type that is not visible to the user.
In order to provide a value for it, we must use the onCreateTicket() callback and pass an extra field value.

Example

JavaScript
ticketform.onCreateTicket = (values) => {
  // The ID of a hidden field
  const fieldID = 'nxq7m';
 
  const newFieldValues = [...values, 
    {
      id: fieldID,
      type: 'HIDDEN',
      value: 'This is the hidden value...',
    },
  ]
 
  return newFieldValues;
};
ℹ️

You can find the field ID in the Ticket Form settings under the Fields tab.
Next to each field, you will see the field ID.

A value for a hidden field can be anything, but must be either a string, number, or boolean type.


Aidbase Docs © 2024