mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-02 20:48:44 +05:00
feat: added form validation
This commit is contained in:
1 parent
99088fb723
commit
2adbda6832
4 files changed
+26
-20
No files matched your search
@@ -4,6 +4,12 @@ function setupForm(formSelector) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.querySelectorAll('input').forEach(item => {
|
||||
item.addEventListener('change', (e) => {
|
||||
e.target.setAttribute('aria-invalid', !e.target.checkValidity());
|
||||
})
|
||||
});
|
||||
|
||||
const url = form.action;
|
||||
let button = form.querySelector('button[type="submit"]');
|
||||
let defaultText;
|
||||
|
||||
Reference in new issue
Block a user