Toggle menu

helper.showFieldRequired(fieldName [, requiredMarker ] [, titleText])

Displays the "required" markup of a field.

This function can also set the marker used by the field and change the title used in the field's markup. The title is often used to style the marker (for example, our standard themes look for <em title="required"></em> to colour the marker red).

Note that this function does not change the field's validation or required state, it only displays a marker next to the label. You will need to write an accompanying validation function to change the field's requiredness.

Executed

Client-side

Arguments

ArgumentTypeDescription
fieldNameString, requiredThe name of the field to show the marker for
requiredMarkerString, optionalThe marker to display next to the field's label. Default: *
titleTextString, optionalThe title text used in the field markup. Default: required

Example

This example will display an exclamation mark next to the label of FIELD9.

function(helper) {
    helper.showFieldRequired('FIELD9', '!');
}

Last modified on 06 March 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon