Child pages
  • JavaScript functions

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Since version 2.21.5 ConfiForms provides some helper functions for you to use to cover some common scenarios


Excerpt
22.12.22.1 fieldValue, 22.1radio
Available since versionFunction DescriptionDemo

Status
colourGreen
title2.21.5

function cfAddFieldRequired(formId, fieldName)

Adds required field mark / asterisk. This does not make the field required - you need to have an additional validation in place to validate the field's value

Multimedia
namecfAddFieldRequired.mov
width600

Status
colourGreen
title2.21.5

function cfRemoveFieldRequired(formId, fieldName)Removes required field mark / asterisk from a field. Important to know that if the field is set as required in ConfiForms Field Definition then it still remains as required and users must provide a value before they can submit the form. This function only changes the visual appearance of a field label

Status
colourGreen
title2.21.5

function cfAddTabStop(formId, fieldName)Adds "tab stop", meaning that the field will be excluded from form's set of fields when moving around using the "tab" key 

Multimedia
namecfAddTabStop.mov
width600


Status
colourGreen
title2.21.5

function cfRemoveTabStop(formId, fieldName)Removes the "tab stop" marker from a field

Status
colourGreen
title2.

23

function cfSetValue(formId, fieldName, fieldValue, isAdvanced = false)Set's value on a field. Set "isAdvanced = true" if you want to set the value on "advanced" fields (such as dropdown fields with lookup, etc)

Status
colourGreen
title3.8

function cfSetValueWithEventPropagation(formId, fieldName, fieldValue, eventType, isAdvanced = false)

Same as "cfSetValue" function but  triggers an eventType event

eventType can be of the following type:

  • change
  • input
  • blur
  • keyup

This depends on the field you want to trigger this for. Text fields expect 'input', dropdowns and other choice based fields - "change"; Jira, user and page lookup fields expect a "blur"


Status
colourGreen
title2.23

function cfResetValue(formId, fieldName, isAdvanced = false)Resets value on a field (sets it to empty state).

Status
colourGreen
title2.

23

function cfSetValueByIndex(formId, fieldName, index, isAdvanced = false)Selects value by index in a dropdown (simple or advanced) field. Options start with 0 index (so, the first option will be with index = 0)

Status
colourGreen
title3.8

function cfToggleReadOnly(formId, fieldName, isReadOnly, isAdvanced = false) Toggles readonly attribute (either adds it or removes it, depending on a isReadOnly parameter value)

Status
colourGreen
title3.8

function cfToggleDisabled(formId, fieldName, isDisabled, isAdvanced = false) Toggles disabled attribute (either adds it or removes it, depending on a isDisabled parameter value)

Status
colourGreen
title3.10

function cfTriggerEvent(formId, fieldName, eventName) 

eventName can be of the following type:

  • change
  • input
  • blur
  • keyup

Status
colourGreen
title3.11

function cfGetValue(formId, fieldName) 

Retrieves value from a form's field


Status
colourGreen
title3.11

function cfGetValueBySelector(formId, fieldSelector)

Retrieves value from a form by CSS selector