Skip to content

3BRS/jquery-ajax-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

jQuery AJAX form validation

Expected data format

{
    "success": false,
    "errors": {
        "email": ["Email is not valid"],
        "password": ["Password is not valid", "Password is too short"]
    }
}

Options

  • submitUrl
    default: action of the form
  • redirectUrl
    default: action of the form
  • inputsSelector
    default: 'input, select, textarea'
  • inputWrapperSelector
    Element that wraps the input
    default: '.form-group'
  • successClass
    Class that will be appended to inputs, that have no errors
    default: 'has-success'
  • errorClass
    Class that will be appended to inputs, that have errors
    default: 'has-error'
  • errorElement
    Element Containing error message, will be appended after the input with error
    default: '<div class="form-error"></div>'
  • debug
    Prints some debugging info
    default: false

Callbacks

  • onError($input, errors, $form)
  • onValid($input, $form)
  • beforeValidation($form)
  • onValidationReceived(data, $form)
  • beforeRedirect($form)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published