
I'm in a repeating section, and I'm loading attributes for an inventory item after looking them up (keyed on item name) in a little object array in a worker script. Following a hint picked up on this board somewhere, I'm using the javascript to load an attribute that's tied to a hidden input field, and then using value="@{attr}" to display the attribute in a non-editable field. Here's the actual code snippet: ... <fieldset class="repeating_bludgeon"> <select class="sheet-input-itemname" name="attr_bludgeon-name" value="name"> <option>(select one></option> <option>Club</option> <option>Mace</option> </select> <input type="text" class="sheet-input-damage" name="attr_bludgeon-hidden-damage" value="0d6" hidden /> <input type="text" class="sheet-input-damage" name="attr_bludgeon-damage" value='@{bludgeon-hidden-damage}' disabled /> </fieldset> ... <script type="text/worker"> on ("change:repeating_bludgeon:bludgeon-name", function(eventInfo) { let RID = eventInfo.sourceAttribute.slice(19,39); getAttrs(['repeating_bludgeon_bludgeon-name'], function(values) { let club = {name:"Club", TL:"1", damage:"2d6", weight:"3", cost:"0", ap:"0" }; let mace = {name:"Mace", TL:"1", damage:"2d6+2", weight:"3", cost:"20", ap:"0" }; let bludgeons = [club, mace]; for (i = 0 ; i < bludgeons.length ; i++) { if (bludgeons[i].name == values['repeating_bludgeon_bludgeon-name']) { setAttrs({['repeating_bludgeon_'+RID+'_bludgeon-hidden-TL']: bludgeons[i].TL, ['repeating_bludgeon_'+RID+'_bludgeon-hidden-damage']: String(bludgeons[i].damage), ['repeating_bludgeon_'+RID+'_bludgeon-hidden-weight']: bludgeons[i].weight}); } } }) }) </script> The String() on the damage is from an attempt to fix the problem. Which is... When I run this, and select "club", what ends up appearing in the damage textbox is "26", not "2d6". When I select mace, it's "28" - and since 8 = "6+2", I'm pretty sure that something somewhere along the way is attempting to either evaluate "2d6", or at least clean it up and make it look like a presentable number (stripping the "d" and even doing the math!) It's not the javascript. If I get rid of the "hidden"/"disabled" thing, and just load an enabled, visible field direct from js, it works properly, so I know js is delivering the string the way it is supposed to. I will accept any/all input, advice, (or even Gibbs-slaps if its something silly I should have noticed). Thanks in advance.