开发者

change error messages after form validation in Magento

开发者 https://www.devze.com 2023-01-05 05:24 出处:网络
how can i change the er开发者_如何学JAVAror message Magento throws after it validates the form? thanksfound it at

how can i change the er开发者_如何学JAVAror message Magento throws after it validates the form? thanks


found it at

.../js/prototype/validation.js

there's a list of the conditions and the error message that corresponds to it.


You can change the error message on the fly inside your validation function using this.error="custom message"

['validate-zip-extra', 'Please enter a valid zip code', function (v) {
        v = v.trim();
        this.error = "custom validation error extra";
        var regexpString = /^[0-9][0-9][0-9][1-9](\s)?([a-z]{2})$/i;
        return Validation.get('IsEmpty').test(v) || regexpString.test(v);
    } else {
        return true;
    }
}],
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号