Fix JavaScript validation and add Bootstrap table attributes

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-22 14:55:22 +00:00
parent 47976c8422
commit e5e14c44f6
2 changed files with 16 additions and 2 deletions

View File

@@ -15,7 +15,20 @@
<div class="wrapper-scroll-table">
<div class="row">
<div class="col overflow-auto">
<table id="contentTable" class="table table-striped">
<table id="contentTable" class="table table-striped"
data-click-to-select="true"
data-check-on-init="true"
data-mobile-responsive="true"
data-min-width="562"
data-show-export="true"
data-show-columns="true"
data-uncheckAll="true"
data-cookie="true"
data-cookie-same-site="Strict"
data-cookie-id-table="zmAIClassesTable"
data-cookie-expire="2y"
data-remember-order="false"
>
<thead class="thead-highlight">
<tr>
<th class="colId"><?php echo translate('Id') ?></th>

View File

@@ -6,7 +6,8 @@ function validateForm(form) {
if (!form.elements['newAIClass[ClassName]'].value) {
errors[errors.length] = 'You must supply a class name';
}
if (!form.elements['newAIClass[ClassIndex]'].value && form.elements['newAIClass[ClassIndex]'].value !== '0') {
var classIndexValue = form.elements['newAIClass[ClassIndex]'].value;
if (!classIndexValue && classIndexValue !== '0') {
errors[errors.length] = 'You must supply a class index';
}
if (errors.length) {