radios at least

main
Bel LaPointe 2024-02-20 15:03:15 -07:00
parent b3c18b56ed
commit 2dda72cfa3
1 changed files with 10 additions and 4 deletions

View File

@ -21,7 +21,7 @@
<h1><span id="question-text"></span></h1>
</div>
<form id="answer-form" action="#" onsubmit="submitAnswersForm(this); return false;">
<ul id="question-options"></ul>
<div id="question-options"></div>
<input id="answers-freeform" type="text" hidden/>
</form>
</body>
@ -49,9 +49,15 @@
if (g_live_question) {
let options = "";
for (let i of g_live_question.Options)
options += `<li>${i}</li>`;
document.getElementById("question-text").innerHTML = g_live_question.Text;
document.getElementById("question-options").innerHTML = options;
options += `<div>
<input type="radio" value="${i}" name="g_live_question.Options" />
<label for="${i}">${i}</label>
</div>`
options = `<fieldset>${options}</fieldset>`;
if (document.getElementById("question-text").innerHTML != g_live_question.Text) {
document.getElementById("question-text").innerHTML = g_live_question.Text;
document.getElementById("question-options").innerHTML = options;
}
} else {
document.getElementById("question-text").innerHTML = "";
document.getElementById("question-options").innerHTML = "";