formcycle 8.3.6 - JavaScript for forms
    Preparing search index...

    Interface FieldValidationsDescriptor

    The configuration that describes the validation rules that should be applied to a certain form element.

    interface FieldValidationsDescriptor {
        hif?: string;
        hif_c?: string;
        hif_cl?: string;
        hif_v?: string;
        hnotif?: string;
        roif?: string;
        roif_c?: string;
        roif_cl?: string;
        roif_v?: string;
        rom?: string;
        ronotif?: string;
        vcmn?: string;
        vcmx?: string;
        vdt?: string;
        veq?: string;
        vfex?: string;
        vfmx?: string;
        vgr?: string;
        vmn?: string;
        vmnl?: string;
        vmx?: string;
        vmxl?: string;
        vr?: string;
        vrif?: string;
        vrif_c?: string;
        vrif_v?: string;
        vrmm?: string;
        vrnotif?: string;
        vrule?: string;
    }
    Index

    Properties

    hif?: string

    A form element can be hidden automatically based on the value of another form element. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not hidden automatically.

    Similar to hnotif, but this attribute is set when the form element is initially visible.

    hif_c?: string

    A form element can be hidden automatically based on the value of another form element. This is the condition applied to the value of the other form element. Available condition types are:

    • 0 (has a value): The form field is hidden when the other field is non-empty.
    • 1 (equals): The form field is hidden when the value of the other field equals the hif_v.
    • 2 (does not equal): The form field is hidden when value of the other field does not equal the hif_v.
    • 3 (matches regular expression): The form field is hidden when the other field matches the regular expression contained in hif_v.
    • 4 (is lower than): The form field is hidden when the other field's value is lower than the hif_v.
    • 5 (is greater than): The form field is hidden when the other field's value is greater than the hif_v.
    • 6 (lies between): The form field is hidden when the other field's value lies in the range as specified by hif_v. The hif_v must be a range in the format x-y, e.g. 2-37.
    • 7 (is lower than or equal to): The form field is hidden when the other field's value is lower than or equal to the hif_v.
    • 8 (is greater than or equal to): The form field is hidden when the other field's value is greater than or equal to the hif_v.
    • 9 (has no value): The form field is hidden when the other field does not have a value.
    hif_cl?: string

    A form element can be hidden automatically based on the value of another form element. This is a flag that indicates whether the form element is cleared when it is hidden. Can be set to one of the following options:

    • 0 (keep): The value of the form element is not changed when it is hidden.
    • 1 (clear): The value of the form element is cleared when it is hidden. For text input fields, the value is set to the empty string; for select fields, all selected options are deselected.
    • 2 (reset): The value of the form element is reset to its initial value when it is hidden.
    hif_v?: string

    A form element can be hidden automatically based on the value of another form element. This is the value against which the other form element is compared. Whether this property is required and what it must contain depends on the selected condition, see hif_c for further details.

    hnotif?: string

    A form element can be hidden automatically based on the value of another form element. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not hidden automatically.

    Similar to hif, but this attribute is set when the form element is initially hidden.

    roif?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not disabled field automatically.

    Similar to roif, but this attribute is set when the form element is initially editable.

    roif_c?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. This is the condition applied to the value of the other form element. Available condition types are:

    • 0 (has a value): The form field is read-only when the other field is non-empty.
    • 1 (equals): The form field is read-only when the value of the other field equals the roif_v.
    • 2 (does not equal): The form field is read-only when value of the other field does not equal the roif_v.
    • 3 (matches regular expression): The form field is read-only when the other field matches the regular expression contained in roif_v.
    • 4 (is lower than): The form field is read-only when the other field's value is lower than the roif_v.
    • 5 (is greater than): The form field is read-only when the other field's value is greater than the roif_v.
    • 6 (lies between): The form field is read-only when the other field's value lies in the range as specified by roif_v. The roif_v must be a range in the format x-y, e.g. 2-37.
    • 7 (is lower than or equal to): The form field is read-only when the other field's value is lower than or equal to the roif_v.
    • 8 (is greater than or equal to): The form field is read-only when the other field's value is greater than or equal to the roif_v.
    • 9 (has no value): The form field is read-only when the other field does not have a value.
    roif_cl?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. This is a flag that indicates whether the form element is cleared when it is disabled. Can be set to one of the following options:

    • 0 (keep): The value of the form element is not changed when it is disabled.
    • 1 (clear): The value of the form element is cleared when it is disabled. For text input fields, the value is set to the empty string; for select fields, all selected options are deselected.
    • 2 (reset) The value of the form element is reset to its initial value when it is disabled.
    roif_v?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. This is the value against which the other form element is compared. Whether this property is required and what it must contain depends on the selected condition, see roif_c for further details.

    rom?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. When this property is set to 1, the current value of the disabled text input field is discarded and not submitted to the server. This corresponds to the HTML disabled attribute. Otherwise, when set to 2, the value is submitted to the server. This corresponds to the HTML attribute readonly.

    Please note that this property is not available for other form elements as the readonly HTML attribute is supported only by INPUT elements.

    ronotif?: string

    A form element can be disabled automatically based on the value of another form element. When a form field is disabled, its value cannot be changed anymore. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not disabled field automatically.

    Similar to roif, but this attribute is set when the form element is initially read-only.

    vcmn?: string

    The minimum number of checkboxes or radio buttons that must be checked or selected. When empty, no restriction is applied.

    vcmx

    vcmx?: string

    The maximum number of checkboxes or radio buttons that must be checked or selected. When empty, no restriction is applied.

    vcmn

    vdt?: string

    The data type is used during form validating to ensure the entered data conforms to a certain format. The following built-in data types are currently available:

    • dateDE: Allows only German-style dates (DD.MM.YYYY), e.g. 22.05.1990.
    • email: Allows only valid (international) email addresses, e.g. james@john.org or θσερ@εχαμπλε.ψομ.
    • integer: Allows only integers, that is numbers without a decimal point, e.g. 3, 0, or -21.
    • ipv4: Allows only IP4 addresses, e.g. 127.0.0.1 or 10.42.42.13.
    • money: Requires the input to be a valid amount of money, i.e. a number with exactly two decimal digits, e.g. 2,00, -3,95, 0,00 or 897345,38.
    • number: Allows only numbers, including numbers with a decimal point, e.g. 0.03, -99.2, or 42.
    • onlyLetterNumber: Allows only letters, numbers, and spaces.
    • onlyLetterSp: Allows only letters and spaces.
    • phone: Allows only valid phone numbers, e.g. 0234995483 or +49 351 4459654.
    • plzDE: Allows only postal code from Germany, i.e. exactly 5 digits, e.g. 02349. Does not check whether such a code is actually registered within Germany.
    • posinteger: Allows only positive integers, e.g. 0, 3, oder 123.
    • posmoney : Requires the input to be a valid amount of money, not including negative numbers, e.g. 0,00 or 2,34.
    • posmoneyOptionalComma: Requires the input to be a valid positive amount of money, with the decimal digits being optional, e.g. 0,00, 0, 3,4, or 3.
    • regexp: Allows the user who creates the form to enter a custom (JavaScript flavor) regular expression for validation.
    • text: Applies no restriction and allows every input.
    • time: Requires the input to be a valid time, in the format hh:mm, e.g. 22:05 or 03:42.
    • url: Allows only URLs, including the protocol, e.g. http://example.com or https://www.james.org.
    veq?: string

    When not empty, this property refers to the ID of another form field that must have the same value as the form field. The form field is invalid if the value of the form field is different compared to the value of the referenced form field.

    vfex?: string

    A comma separated list of file extensions (without the leading period) an uploaded file must have, such as xml,js. An upload field is invalid if a file with a different file extension is selected. When empty, all extensions are allowed.

    vfmx?: string

    The maximum file size in kilobytes a single uploaded file is allowed to have. When set to 0, the file size is unlimited.

    vgr?: string

    The required group to which the form field belongs. If a form element is part of a required group, the form is invalid when no element of the required group has a value. The form becomes valid once the user has filled in at least one form field of the required groups.

    vmn?: string

    The minimum numerical value (inclusive) that must be entered. Contrast this with vmnl, which checks the number of characters, not the numerical value these characters represent. When empty, no restriction is applied.

    vmnl?: string

    The minimum number of characters that must be entered in a text field or text area. Please note that this restriction is applied only when the form field is not empty. Thus, when set to 0, the form field is never invalid due to this property. To enforce that the user does not leave the form field empty, use vr.

    vmx?: string

    The maximum numerical value (inclusive) that must be entered. Contrast this with vmxl, which checks the number of characters, not the numerical value these characters represent. When empty, no restriction is applied.

    vmn

    vmxl?: string

    The maximum length of the input that is allowed. If set to 0, the length is unlimited. For input fields and text area, the length of the entered text is checked. For upload fields, the length of the file name is checked.

    vr?: string

    If set to 0, the form element is not required and can be left empty. Otherwise, if set to 1, the form element is required and a value must be entered.

    vrif?: string

    A form element can be made a required field automatically based on the value of another form element. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not made a required field automatically.

    Similar to vrnotif, but this attribute is set when the form element is initially optional.

    vrif_c?: string

    A form element can be made a required field automatically based on the value of another form element. This is the condition applied to the value of the other form element. Available condition types are:

    • 0 (has a value): The form field is a required field when the other field is non-empty.
    • 1 (equals): The form field is a required field when the value of the other field equals the vrif_v.
    • 2 (does not equal): The form field is a required field when value of the other field does not equal the vrif_v.
    • 3 (matches regular expression): The form field is a required field when the other field matches the regular expression contained in vrif_v.
    • 4 (is lower than): The form field is a required field when the other field's value is lower than the vrif_v.
    • 5 (is greater than): The form field is a required field when the other field's value is greater than the vrif_v.
    • 6 (lies between): The form field is a required field when the other field's value lies in the range as specified by vrif_v. The vrif_v must be a range in the format x-y, e.g. 2-37.
    • 7 (is lower than or equal to): The form field is a required field when the other field's value is lower than or equal to the vrif_v.
    • 8 (is greater than or equal to): The form field is a required field when the other field's value is greater than or equal to the vrif_v.
    • 9 (has no value): The form field is a required field when the other field does not have a value.
    vrif_v?: string

    A form element can be made a required field automatically based on the value of another form element. This is the value against which the other form element is compared. Whether this property is required and what it must contain depends on the selected condition, see vrif_c for further details.

    vrmm?: string

    This is the message that is displayed to the user when the value of a form field does not match the vrule regular expression. If not set, a generic error message is displayed.

    vrnotif?: string

    A form element can be made a required field automatically based on the value of another form element. This the ID of the other (referenced) form element. When the value of this property is empty, the form element is not made a required field automatically.

    Similar to vrif, but this attribute is set when the form element is initially required.

    vrule?: string

    This is the regular expression that is used to validate the form field. This must be a valid JavaScript regular expression. Usually it is recommended to use the anchors ^...$ to ensure the whole input conforms to the pattern.