1 つの解決策は、検証の前に検証を添付し、検証が終了した後に削除することです。
jQuery(document).ready(function(){
jQuery("#formID").validationEngine();
$("#formID").bind("jqv.form.validating", function(event){
var fieldsWithValue = $('input[type=text]').filter(function(){
if($(this).val().length>0){
return true;
}
});
if(fieldsWithValue.length<1){
$('input[type=text]').addClass('validate[required,funcCall[requiredOneOfGroup]]');
}
});
$("#formID").bind("jqv.form.result", function(event, errorFound){
$('input[type=text]').removeClass('validate[required,funcCall[requiredOneOfGroup]]');
});
});
function requiredOneOfGroup(field, rules, i, options){
var fieldsWithValue = $('input[type=text]').filter(function(){
if($(this).val().length>0){
return true;
}
});
if(fieldsWithValue.length<1){
return "At least one field in this set must have a value.";
}
}