button _also_ does sumbit??
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5e6537e92c
commit
55bd482551
|
@ -125,19 +125,16 @@
|
||||||
return data;
|
return data;
|
||||||
}).then(set_state);
|
}).then(set_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
function return_handler(e) {
|
function return_handler(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
console.log("wario");
|
||||||
let code = document.getElementById("student_number").value;
|
let code = document.getElementById("student_number").value;
|
||||||
console.log(code);
|
console.log(code);
|
||||||
scan_ticket(code);
|
scan_ticket(code);
|
||||||
document.getElementById("student_number").value = "";
|
document.getElementById("student_number").value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function button_click_handler() {
|
|
||||||
let code = document.getElementById("student_number").value;
|
|
||||||
scan_ticket(code);
|
|
||||||
}
|
|
||||||
document.getElementById("add_student").addEventListener("click", button_click_handler);
|
|
||||||
document.getElementById("student_number_wrapper").addEventListener("submit", return_handler);
|
document.getElementById("student_number_wrapper").addEventListener("submit", return_handler);
|
||||||
document.getElementById("start_scan_btn").addEventListener('click', start_scanning);
|
document.getElementById("start_scan_btn").addEventListener('click', start_scanning);
|
||||||
|
|
||||||
|
@ -255,5 +252,10 @@
|
||||||
|
|
||||||
document.getElementById("file-selector-button").addEventListener("click", upload_csv);
|
document.getElementById("file-selector-button").addEventListener("click", upload_csv);
|
||||||
|
|
||||||
|
|
||||||
|
let elem = document.getElementById("student_number");
|
||||||
|
elem.focus();
|
||||||
|
elem.select();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in a new issue