I am currently trying to create a spell list that is compiled based on a choice in a combobox (i.e. select and option). The idea is simple: I select a spell in a combobox and some values are automatically written (such as range, aoe, save,...). My attempt is to put in each option value a string with different values, separated by a defined separator. In the onchange function I "decode" the string and I put each value in the proper input. In pure HTML/JS works perfectly (I use JSFiddle for testing, and works as expected), but I was not able to make it working in a repeating items section in a character sheet. My hipoteses are: - the main one: the IDs I refer to in my script are not valid in a fieldset, since they have the same ID in each row - the js script does not work in the same way in a character sheet I put a portion of my HTML/scripts. The select: <select onchange="myFunction(event)">
<option value='Aid|5|None|Touch|1 + 1 per level|1 creature'>Aid</option>
<option value='Augury|2 rds.|None|0|Special|Special'>Augury</option>
<option value='Barkskin|5|None|Touch|4+ 1 per level rds.|1 creature'>Barkskin</option> ad so on, here I copied only the first lines, as you can imagine the list is longer. Then the script: function myFunction(e) {
var arr = [];
arr = e.target.value.split('|');
document.getElementById("spellname").value = arr[0];
document.getElementById("casttime").value = arr[1];
document.getElementById("save").value = arr[2];
document.getElementById("range").value = arr[3];
document.getElementById("duration").value = arr[4];
document.getElementById("aoe").value = arr[5];
} Obviously I have some input with the proper ID in the HTML. Any suggestion? Even a totally different way to do it, maybe with the main difference that it works. Thank you.