Translate custom jQuery validation messages

前端 未结 3 1607
忘了有多久
忘了有多久 2021-01-05 06:21

I have a question to ask regarding jQuery validation plugin.

I have used localisation to change the default language of error messages to be displayed in Spanish, bu

3条回答
  •  执念已碎
    2021-01-05 06:42

    You can use a jQuery library called abValidate which you can give localized validation error messages.

    Example:

    $(document).ready(function () {
        $(".ab-form").abValidate({
            color: "#556b2f",
            backgroundColor: "white",
            debug: true
        });
    });
    
       
          
          
          
       
       
          

    You just want to write everything in HTML as below once you initialized your for with abValidate library.

    
    

    abValidate - Github link:
    https://github.com/aslamanver/abvalidate

    Reference:
    https://medium.com/@aslamanver/localized-custom-validation-messages-jquery-2892e021648f

提交回复
热议问题