The code editor field lets a user enter JavaScript, CSS, HTML or Handlebars markup. This field type only works within iCM and is designed to be used in article extra and subsite configuration forms.
Properties
Label | Description | Type Name |
---|---|---|
Label | The label for the field | LABEL |
Show Label | Whether the label for this field will be visible on the form. Set to false to hide the field's label | SHOWLABEL |
Hint | Additional information displayed alongside the field to assist the user. The value of another field can be used by adding the field's name between # characters. See Common Field Properties for more information | HINT |
Required | Whether or not the field is required to have a value to pass validation | REQUIRED |
Default | Default code for the field. This must meet any field level validation set by the other field settings | DEFAULT |
Error Message | The error message that will be displayed if this field fails its validation | ERRMSG |
Error Message Function | A function that can be used to override the default error message. You can return a different message for each error type. The message can include the value of another field can be used by adding the field's name between # characters. See Error Message Functions for more information. This field has the following error types:
| ERRMSGFUNC |
Width | The editor's display width width in pixels. Leave blank to set the width to 'auto' ie to stretch the width to fit | WIDTH |
Height | The height of the field in pixels | HEIGHT |
Editor Type | The type of code to be edited. The editor will be configured to support editing of the selected code type. JavaScript is the default | FORMAT |
Validation Function | A JavaScript function that can be used to provide custom field validation whenever the field value changes or the form is submitted. This function will be executed client-side, provided JavaScript is enabled in the browser, and repeated server-side | VALFUNC |
Default Function | A JavaScript function you can use to calculate the starting field value. This function is executed server-side when the field HTML is generated. See Common Field Properties for an example | DEFFUNC |
Handlers | A JavaScript function that is executed browser-side whenever the page loads or the field value changes. See Common Field Properties for an example | HANDLERS |
Read Only | Display the field as read only | READONLY |
Documentation | Add documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an example | DOCUMENTATION |
Last modified on 26 February 2024