This is a list of Traits the player can choose from below, I’m not sure how to go about displaying the selected traits from this list on a separate passage.
<input type="checkbox" id="$stdy" value="Sturdy" class="chkGroup"> Sturdy
<input type="checkbox" id="$hkeye" value="Hawkeye" class="chkGroup"> Hawkeye
<input type="checkbox" id="$ufg" value="Unflinchable" class="chkGroup"> Unflinchable
<input type="checkbox" id="$dkpf" value="Drunk Proof" class="chkGroup"> Drunk Proof
<input type="checkbox" id="$lif" value="Light Footed" class="chkGroup"> Light Footed
<input type="checkbox" id="$spsk" value="Slippery Skin" class="chkGroup"> Slippery Skin
<input type="checkbox" id="$ttn" value="Tactician" class="chkGroup"> Tactician
<input type="checkbox" id="$lpfl" value="Low Profile" class="chkGroup"> Low Profile
<input type="checkbox" id="$dsma" value="Disarming Alure" class="chkGroup"> Disarmming Alure
<input type="checkbox" id="$ctcw" value="Cat Claws" class="chkGroup"> Cat Claws
<input type="checkbox" id="$fsth" value="Fast Healer" class="chkGroup"> Fast Healer
<input type="checkbox" id="$sdch" value="Second Chance" class="chkGroup"> Second Chance
although I do have a way to limit how many checkboxes the player can check off. so I don’t need much help on this part.
<<script>>
$(document).one(':passagerender', function (ev) {
function selectiveCheck (event) {
var i, checkedChecks = document.querySelectorAll(".chkGroup:checked");
$("#result").empty();
for (i = 0; i < checkedChecks.length; i++) {
if (checkedChecks.length < max + 1) {
$("#result").wiki($(checkedChecks[i]).attr("value") + " ");
} else if (event.target != checkedChecks[i]) {
$("#result").wiki($(checkedChecks[i]).attr("value") + " ");
}
}
if (checkedChecks.length >= max + 1)
return false;
}
var checks = $(ev.content).find(".chkGroup");
var max = 6;
for (var i = 0; i < checks.length; i++) {
checks[i].onclick = selectiveCheck;
}
});
<</script>>
anyway, thanks in advance