Frontend Macros Field Attributes - Crocoblock/jetformbuilder GitHub Wiki

Table of Contents

Introduction

JetFormbuilder offers its own API for managing field attributes. Each of the attributes uses the reactivity mechanism.

Now attributes can be used in formulas to Calculated Field, and in messages to constraints. To do this, you need to write as follows: %text_field(minLength)%. Where text_field is the name of the field, and minLength is the name of the attribute. And reactivity plays its role in the case if you change the value of this attribute through custom code.

Attributes

min

Returns the minimum number. Value from the option "Min value".

Supported form fields

  • Number Field
  • Range Field

max

Returns the maximum number. Value from the option "Max value".

Supported form fields

  • Number Field
  • Range Field

minLength

Returns the minimum number of characters. Value from the option "Min length (symbols)".

Supported form fields

  • Text Field
  • Textarea Field

maxLength

Returns the maximum number of characters. Value from the option "Max length (symbols)".

Supported form fields

  • Text Field
  • Textarea Field

remaining

Returns the difference between the maximum available number of characters and the entered characters.
If maxLength attribute is 40 and the word Hello is entered in the field, the remaining attribute will return 35.

This attribute depends on minLength, if it is not supported by the field or is empty, then remaining will not work.

Supported form fields

  • Text Field
  • Textarea Field

max_files

Returns the maximum number of files that can be uploaded. Value from the option "Maximum allowed files to upload".

Supported form fields

  • Media Field

max_size

Returns the maximum size of one file in bytes. Value from the option "Maximum allowed files to upload".

Supported form fields

  • Media Field

file_ext

Returns an array of supported file extensions. Value from the option "Allow mime types".

Supported form fields

  • Media Field

Useful links

:small_orange_diamond: View source of current page