diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index e58739f1..3aa890d1 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -30,6 +30,7 @@ return [ 'title' => lng('admin.domain_add'), 'image' => 'fa-solid fa-globe', 'self_overview' => ['section' => 'domains', 'page' => 'domains'], + 'id' => 'domain_add', 'sections' => [ 'section_a' => [ 'title' => lng('domains.domainsettings'), @@ -139,8 +140,7 @@ return [ 'type' => 'checkbox', 'values' => $ipsandports, 'value' => explode(',', Settings::Get('system.defaultip')), - 'is_array' => 1, - 'mandatory' => true + 'is_array' => 1 ], 'selectserveralias' => [ 'label' => lng('admin.selectserveralias'), diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index fe5aaf7a..8c724a8f 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -30,6 +30,7 @@ return [ 'title' => lng('admin.domain_edit'), 'image' => 'fa-solid fa-globe', 'self_overview' => ['section' => 'domains', 'page' => 'domains'], + 'id' => 'domain_edit', 'sections' => [ 'section_a' => [ 'title' => lng('domains.domainsettings'), @@ -153,8 +154,7 @@ return [ 'type' => 'checkbox', 'values' => $ipsandports, 'value' => $usedips, - 'is_array' => 1, - 'mandatory' => true + 'is_array' => 1 ], 'selectserveralias' => [ 'label' => lng('admin.selectserveralias'), diff --git a/templates/Froxlor/src/js/components/validation.js b/templates/Froxlor/src/js/components/validation.js index ef34b3e9..4b19f3de 100644 --- a/templates/Froxlor/src/js/components/validation.js +++ b/templates/Froxlor/src/js/components/validation.js @@ -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 + } + }, + }); + }); });