This commit is contained in:
Ross
2021-01-23 17:13:47 +00:00
parent 4164bf5a96
commit 38577a1178
+11 -15
View File
@@ -156,24 +156,20 @@
});
// Hook into the form submission
function processForm(e) {
console.log("SUBMIT")
if (e.preventDefault) e.preventDefault();
if (document.getElementById("id_normal").checked){
$("#answer_form_set textarea").attr("required", false)
}
return false;
}
var form = document.getElementById('rapid-form');
if (form.attachEvent) {
form.attachEvent("submit", processForm);
function ifNormal(){
if (document.getElementById("id_normal").checked){
$("#answer_form_set textarea").attr("required", false)
} else {
form.addEventListener("submit", processForm);
$("#answer_form_set textarea").attr("required", true)
}
}
$("#id_normal").change(() => ifNormal());
ifNormal();
});