-
Notifications
You must be signed in to change notification settings - Fork 19
Frontend Macros Field Attributes
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.
Returns the minimum number. Value from the option "Min value".
- Number Field
- Range Field
Returns the maximum number. Value from the option "Max value".
- Number Field
- Range Field
Returns the minimum number of characters. Value from the option "Min length (symbols)".
- Text Field
- Textarea Field
Returns the maximum number of characters. Value from the option "Max length (symbols)".
- Text Field
- Textarea Field
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.
- Text Field
- Textarea Field
Returns the maximum number of files that can be uploaded. Value from the option "Maximum allowed files to upload".
- Media Field
Returns the maximum size of one file in bytes. Value from the option "Maximum allowed files to upload".
- Media Field
Returns an array of supported file extensions. Value from the option "Allow mime types".
- Media Field
Need more information? Check out the official documentation at jetformbuilder.com or contact Crocoblock Support