From 9354d406510aa2e193d39b93b128a160fde9f603 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 23 Jan 2021 17:03:24 +0000 Subject: [PATCH] . --- rapids/templates/rapids/rapid_form.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index b89e546f..647d381e 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -155,6 +155,26 @@ ocr(this); }); + + // Hook into the form submission + function processForm(e) { + 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); + } else { + form.addEventListener("submit", processForm); + } + + }); function ocr(input) { // Tesseract.recognize(f, "eng",{ logger: m => console.log(m) }