.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user