aboutsummaryrefslogtreecommitdiff
path: root/src/docs-google-com-fix-forms
diff options
context:
space:
mode:
authorJacob K <jacobk@disroot.org>2022-08-14 19:12:03 -0500
committerJacob K <jacobk@disroot.org>2022-08-14 19:12:03 -0500
commit9d2797cc014557670d997676176904b25bbeebf2 (patch)
treee85770a2c95b82fcdd7e09ad2c37128abe318c2b /src/docs-google-com-fix-forms
parent3ac15f3d0a591857c5fbc48e0e8025c138d31be9 (diff)
downloadhydrilla-fixes-bundle-9d2797cc014557670d997676176904b25bbeebf2.tar.gz
hydrilla-fixes-bundle-9d2797cc014557670d997676176904b25bbeebf2.zip
[Google Forms] Add (untested) checkbox support.
Diffstat (limited to 'src/docs-google-com-fix-forms')
-rw-r--r--src/docs-google-com-fix-forms/google_forms.js8
1 files changed, 8 insertions, 0 deletions
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;