Upload files to "assets/js"
This commit is contained in:
parent
c291f2755c
commit
ad8562c3ef
16
assets/js/reg.js
Normal file
16
assets/js/reg.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const form = document.querySelector('form');
|
||||||
|
form.addEventListener('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
const activeElement = document.activeElement;
|
||||||
|
if (activeElement.tagName === 'INPUT' && activeElement.type !== 'submit') {
|
||||||
|
event.preventDefault();
|
||||||
|
const formElements = Array.from(form.elements);
|
||||||
|
const currentIndex = formElements.indexOf(activeElement);
|
||||||
|
if (currentIndex !== -1 && formElements[currentIndex + 1]) {
|
||||||
|
formElements[currentIndex + 1].focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user