Getting Started

Options

List including all options

showErrorMessages

Type: Bolean Default: True

The value of showErrorMessages should be set to true if you want to display validation messages for each field. If you only want to show a red outline without displaying error messages, then set "showErrorMessages" to false. In this case, error messages will not be displayed, and only a red outline will appear around each field.

formClass

Type: String Default: .jnForm

You can assign any class of your choice to the form using the formClass. However, the same class must also be used in the form tag. This means that the class assigned to the form tag should be passed to formClass. Otherwise, form validation will not work.

errorMessages

Type: Object Default: Empty Object Object containing error messages for all fields.

Error Messages

By default, the following error messages will be displayed when the form validation fails. However, if you want to customize them according to your preferences, you can modify the errorMessages object. All error messages will be stored in "errorMessages" object, and the library will automatically use them for displaying the relevant messages.

    errorMessages : {
        email: "Please enter a valid email address.",
        text: "Please enter some text.",
        password: "Please enter a valid password.",
        tel: "Please enter a valid phone number.",
        number: "Please enter a valid number.",
        checkbox: "This option must be checked.",
        radio: "Please select an option.",
        select: "Please select an option.",
        textarea: "Please enter some text.",
        file: "Please upload a valid file.",
        search: "Please type for search",
        url: "Please enter a valid url",
        date: "Please enter a valid date.",
        time: "Please enter a valid time.",
        datetimeLocal: "Please enter a valid date and time.",
        month: "Please enter a valid month.",
        week: "Please enter a valid week.",
        range: "Please enter a valid range.",
        color: "Please select a color."
    }