[UI] change require of ipandport field in domains.add and domains.delete to one-of instead of all; fixes #1078

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-01-12 14:53:05 +01:00
parent 9e671100ae
commit b52d6df777
3 changed files with 23 additions and 13 deletions

View File

@@ -1,19 +1,19 @@
$(document).ready(function() {
$('#customer_add,#customer_edit').each(function(){
$(document).ready(function () {
$('#customer_add,#customer_edit').each(function () {
$(this).validate({
rules:{
'name':{
required:function(){
rules: {
'name': {
required: function () {
return $('#company').val().length === 0 || $('#firstname').val().length > 0;
}
},
'firstname':{
required:function(){
'firstname': {
required: function () {
return $('#company').val().length === 0 || $('#name').val().length > 0;
}
},
'company':{
required:function(){
'company': {
required: function () {
return $('#name').val().length === 0
&& $('#firstname').val().length === 0;
}
@@ -21,4 +21,14 @@ $(document).ready(function() {
},
});
});
$('#domain_add,#domain_edit').each(function () {
$(this).validate({
rules: {
'ipandport[]': {
required: true,
minlength: 1
}
},
});
});
});