mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
fix validation if just file from library is given
This commit is contained in:
parent
fae159a5f3
commit
5584cedce3
|
@ -77,9 +77,14 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
jQuery.validator.addMethod("alternatives", function(value, element, params) {
|
||||
if(value == '' && params.val() == '')
|
||||
return false;
|
||||
return true;
|
||||
if(value != '')
|
||||
return true;
|
||||
var valid = false;
|
||||
$.each(params, function( index, value ) {
|
||||
if(params.val != '')
|
||||
valid = true
|
||||
});
|
||||
return valid;
|
||||
}, "<?php printMLText("js_no_file");?>");
|
||||
$("#form1").validate({
|
||||
invalidHandler: function(e, validator) {
|
||||
|
@ -94,10 +99,10 @@ $(document).ready(function() {
|
|||
},
|
||||
rules: {
|
||||
'userfile[]': {
|
||||
alternatives: $('#dropfolderfileform1')
|
||||
alternatives: [$('#dropfolderfileform1'), $('#choosedocsearch')]
|
||||
},
|
||||
dropfolderfileform1: {
|
||||
alternatives: $(".btn-file input")
|
||||
alternatives: [$(".btn-file input"), $('#choosedocsearch')]
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user