Skip to main content

โœณ Add Asterisk to Address Block Labels

Slate doesn't offer an easy way to edit some form labels. You can use the Edit Scripts / Styles tool to add JavaScript that modifies the labels. Here's an example screenshot:

image.png

In this example, our address block's export key is sys:school:location. The below script will append &nbsp;<span style="color: red;">*</span> to each label. Change the two variables to suit your use case.

// Append asterisk to required fields
var address_export = $('[data-export="sys:school:location"]');
var asterisk = '&nbsp;<span style="color: red;">*</span>';

address_export.find('label').append(asterisk);
    // Update region label when country changes
    address_export.find('select[name$="_country"]').change(function () {
        address_export.find('label[for$="_region"]').append(asterisk);
    });