fix(frontend): reset form selections when modifying parent form
This commit is contained in:
parent
82cba2e2c3
commit
337bd3a900
@ -145,12 +145,24 @@ function make_table(url) {
|
||||
|
||||
function select_pdf() {
|
||||
Cookies.set("id", document.getElementById("links").value);
|
||||
reset_forms();
|
||||
document.getElementById("type").value = "none";
|
||||
document.getElementById("form-teacher").setAttribute("hidden", "");
|
||||
document.getElementById("form-classes").setAttribute("hidden", "");
|
||||
document.getElementById("form-type").removeAttribute("hidden");
|
||||
}
|
||||
|
||||
function reset_forms() {
|
||||
document.getElementById("year").value = "none";
|
||||
document.getElementById("section").value = "none";
|
||||
document.getElementById("major").value = "none";
|
||||
document.getElementById("teacher").value = "";
|
||||
}
|
||||
|
||||
function select_type() {
|
||||
let id = document.getElementById("links").value;
|
||||
let value = document.getElementById("type").value;
|
||||
reset_forms();
|
||||
if (value === "teacher") {
|
||||
load_teachers(id);
|
||||
document.getElementById("form-teacher").removeAttribute("hidden");
|
||||
|
Loading…
Reference in New Issue
Block a user