Skip to main content

Custom Form Fields

You can add custom form fields to the competition entry process for guest entries.

You can add fields to the

  • entry header
  • entrant details

Fields to be added to a page are described using JSON.

Basic JSON format

The basic description format is as follows;

{
"header": [

],
"entrants": [

]
}

Fields are displayed in the order they are defined in the respective header and entrants arrays.

Available fields

The following field types are available;

Textbox

For strings of up to 255 characters.

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
helpHelp text associated with the field.

Textarea

For longer strings with multiple lines allowed.

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
helpHelp text associated with the field.

Number

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
helpHelp text associated with the field.
precisionNumber of decimal places to support.

Datetime

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
helpHelp text associated with the field.
minMinimum datetime.
maxMaximum datetime.
showTimeInputWhether to show the time picker. Default false.

Select

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
helpHelp text associated with the field.
valuesArray of value/name pairs.

The values array looks like;

[
{ value: "draft", name: "Draft" },
{ value: "published", name: "Published" },
{ value: "paused", name: "Paused" },
{ value: "closed", name: "Closed" },
{ value: "cancelled", name: "Cancelled" },
]

Checkbox

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.

Radio

PropertyRequiredDescription
nameName of the field. Must be unique.
labelField label.
valuesArray of value/name pairs.

<p>

PropertyRequiredDescription
valueText to display.

Paragraph of text.