validateElement()

Validate a particular element

validateElement(field: String, element: HTMLElement): Promise

* presents a required parameter

  • field * — The field name
  • element * — The field element

fv
    .validateElement('userName', userNameEle)
    .then(function(status) {
        // status can be one of the following value
        // 'NotValidated' (FormValidation.Status.NotValidated): The element is not yet validated
        // 'Valid' (FormValidation.Status.Valid): The element is valid
        // 'Invalid' (FormValidation.Status.Invalid): The element is invalid
        ...
    });