The cases are as follow:
Case 1 Top of mind, first box mandatory
Copy the following code:
/* STARTS EDITING PART */
let questionCode = "Q1";
let topOfMind = true;
let emptyValue = 0;
let emptyFields = true;
/* ENDS EDITING PART */
let scripts = ["https://synocdn.com/js/survey/library/multiple_open_text.js"];
let promises = scripts.map((script) => {
return new Promise((resolve, reject) => {
document.querySelector("body").style.opacity = "0";
let s = document.createElement("script");
s.src = script;
s.onload = resolve;
s.onerror = reject;
document.head.appendChild(s);
});
});
Promise.all(promises)
.then(() => {
multiple_open_text({
question_code: questionCode,
top_of_mind: topOfMind,
fill_empty_with: emptyValue,
allow_empty_fields: emptyFields,
});
document.querySelector("body").style.opacity = "1";
})
.catch((error) => {
console.error(`Failed to load script: ${error}`);
});The code line "let topOfMind = true;" will only require the first input field.
The toggle "Require" must be turned off: