From 9d2797cc014557670d997676176904b25bbeebf2 Mon Sep 17 00:00:00 2001 From: Jacob K Date: Sun, 14 Aug 2022 19:12:03 -0500 Subject: [Google Forms] Add (untested) checkbox support. --- src/docs-google-com-fix-forms/google_forms.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/docs-google-com-fix-forms/google_forms.js b/src/docs-google-com-fix-forms/google_forms.js index 2abf3fa..22e783c 100644 --- a/src/docs-google-com-fix-forms/google_forms.js +++ b/src/docs-google-com-fix-forms/google_forms.js @@ -45,6 +45,14 @@ for (let div of form.querySelectorAll('div[data-params]')) { new_radio.value = input_div.getAttribute("data-value"); input_div.replaceWith(new_radio); } + /* handle checkboxes */ + for (const input_div of div.querySelectorAll('[data-answer-value]')) { + const new_checkbox = document.createElement('input'); + new_checkbox.type = 'checkbox'; + new_checkbox.name = name; + new_checkbox.value = input_div.getAttribute("data-answer-value"); + input_div.replaceWith(new_checkbox); + } } else { input.removeAttribute('disabled'); input.name = name; -- cgit v1.2.3