Verification du statut avant la creation d'un contrat

This commit is contained in:
2026-04-30 13:28:57 +02:00
committed by Soriba SYLLA
parent fcfac71026
commit f6b90e7dd0
269 changed files with 44845 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
'use strict';
{
const inputTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
const modelName = document.getElementById('django-admin-form-add-constants').dataset.modelName;
if (modelName) {
const form = document.getElementById(modelName + '_form');
for (const element of form.elements) {
// HTMLElement.offsetParent returns null when the element is not
// rendered.
if (inputTags.includes(element.tagName) && !element.disabled && element.offsetParent) {
element.focus();
break;
}
}
}
}