diff --git a/JavaScript Files/Add Row Button.js b/JavaScript Files/Add Row Button.js new file mode 100644 index 0000000..c147405 --- /dev/null +++ b/JavaScript Files/Add Row Button.js @@ -0,0 +1,23 @@ +Qualtrics.SurveyEngine.addOnReady(function () { + show_row = 3; + choice_rows = this.getChoiceContainer().querySelectorAll("[class*='Choice']"); + choice_rows[choice_rows.length - 1].insertAdjacentHTML( + "afterend", + "" + ); + for (i = show_row; i < choice_rows.length; i++) { + choice_rows[i].hide(); + } + add_row = this.getChoiceContainer().querySelector("#row_adder"); + add_row.onclick = new_row; + + function new_row() { + if (show_row < choice_rows.length) { + choice_rows[show_row].show(); + show_row++; + } + else{ + alert("You've reached the maximum number of permissible rows"); + } + } +}); \ No newline at end of file