jquery.validation - how to ignore default values when validating mandatory fields

前端 未结 8 1147
一向
一向 2020-12-03 00:00

I am using jquery validation plugin to validate a registration form.

Each text input field has instructions pre-filled as values in the input box

ex: for a

8条回答
  •  不知归路
    2020-12-03 00:24

    If you want to add a custom error message to it jus tuse this.

    jQuery.validator.addMethod("defaultInvalid", function(value, element) {
        return !(element.value == element.defaultValue);
    }, 'Custom Error Message for this field');
    

提交回复
热议问题