如何在magento中使用prototype validation.js添加回调函数

如何在magento中使用prototype validation.js添加回调函数,validation,magento,prototypejs,prototype,Validation,Magento,Prototypejs,Prototype,我想扩展表单验证原型类(MagentoRoot/js/prototype/validation.js),并想用它添加一个回调函数。我知道在下面的代码片段中,第四个参数是用于回调函数的,但我不知道如何将该回调函数作为第四个参数传递(语法) Validation.addAllThese([ ['validate-select-custom', 'Please select an option.', function(v) { return ((v != "no

我想扩展表单验证原型类(MagentoRoot/js/prototype/validation.js),并想用它添加一个回调函数。我知道在下面的代码片段中,第四个参数是用于回调函数的,但我不知道如何将该回调函数作为第四个参数传递(语法)

Validation.addAllThese([
    ['validate-select-custom', 'Please select an option.', function(v) {
                return ((v != "none") && (v != null) && (v.length != 0));
    },<callbackfunction>],
Validation.addAllthis([
['validate-select-custom','请选择一个选项',函数(v){
返回((v!=“none”)&&&(v!=null)&&(v.length!=0));
},],
实际上,我想在验证失败/通过后执行我的自定义代码,因此我想添加带有验证的回调函数


提前谢谢!

看一下@Thank R.S,但这对我没有多大帮助,因为我对原型脚本不太熟悉。您能告诉我如何在给定的代码段中将回调函数名作为参数传递吗?