我正在按照这个示例http://livevalidation.com/documentation#ValidateCustom检查两个字段是否都已填写。因此,如果第一个字段不为空,则第二个字段不能为空,反之亦然。
谁能弄清楚为什么这段代码不起作用?
var txtFirstName = new LiveValidation('txtTaco', {onlyOnSubmit: true } );
txtFirstName.add( 
    Validate.Custom( 1, { against: function(value,args){
        if(args.first||args.last){
            if(args.first&&args.last){
                return true;
            } else {
                return false;
            }
        }
   }, 
   args: {
      first:txtTaco.value,
      last:lastName.value} 
   }) //end custom
); // end add