test and corrections

This commit is contained in:
Benjamin Dalsass
2025-11-27 10:58:21 +01:00
parent d0a2af44ac
commit b8a093e625
22 changed files with 457 additions and 119 deletions

View File

@@ -3,12 +3,25 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$aFormBlockDataTransmittedData = {};
function triggerTurbo(el) {
let sFormName = el.form.getAttribute("name");
el.form.querySelector(`[name="${sFormName}[_turbo_trigger]"]`).value = el.getAttribute('name');
el.form.setAttribute('novalidate', true);
el.form.requestSubmit();
console.log('Auto submitting form due to change in field ' + el.getAttribute('name'));
const name = el.getAttribute('name');
if(isCheckbox(el) || $aFormBlockDataTransmittedData[name] !== el.value) {
let sFormName = el.form.getAttribute("name");
el.form.querySelector(`[name="${sFormName}[_turbo_trigger]"]`).value = el.getAttribute('name');
el.form.setAttribute('novalidate', true);
el.form.requestSubmit();
$aFormBlockDataTransmittedData[name] = el.value;
}
}
function isCheckbox (element) {
return element instanceof HTMLInputElement
&& element.getAttribute('type') === 'checkbox'
}
function addFormToCollection(e) {