Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Help with Nested Field Sets

1537904765

Edited 1537905026
FistOFun
Sheet Author
Hi&nbsp; I've been working on the VtM 5e sheet with some friends unfortunately I'm kind of at the limit of my ability now and am having issues implementing some changes. I've been banging my head against a wall and would really appreciate some assistance. My current test repo is here: <a href="https://github.com/Kirintale/roll20-character-sheets/tree/master/vampire-v5" rel="nofollow">https://github.com/Kirintale/roll20-character-sheets/tree/master/vampire-v5</a> I currently have an issue and I was wondering if anyone could spare 10 minutes or so to have a look. (I'll be posting notes linking ot the code rather than the code itself as I may miss out something important when posting just code snippets). The issue: Load the character sheet and scroll down to the "Discplines" section and add a discipline Click the arrow &lt; next to the word "Powers" to reveal an input area for the powers and their details. (This is line 1809 in the code) What I would like to do is to be able to have as many "Powers" for each discipline as the user wants. I've tried to wrap my intended code (Lines 1809 -&gt; 1873) in a second fieldset with a different name. The issue is that doing so seems to not only break the first field set but have other odd repercussions. If someone could look at the code and give me some ideas I would be most grateful. In the code below basically what I want to do is start my second nested fieldset to encompass everything within&nbsp; &lt; div style = " text-align: left;" class = "sheet-arrowBox" &gt; &lt; div style = " width:834px" class = "sheet-auto-style8" &gt; &lt; fieldset class = "repeating_discipline" &gt; &lt; div style = " text-align: center" &gt; &lt; input type = "text" name = "attr_DisciplineName" style = " width:300px; display:inline-block" /&gt; &lt; div class = "sheet-col" style = " line-height:28px; display:inline-block" &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox zero" name = "attr_Discipline" value = "0" checked /&gt; &lt; span &gt;&lt;/ span &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox" name = "attr_Discipline" value = "1" /&gt; &lt; span &gt;&lt;/ span &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox" name = "attr_Discipline" value = "2" /&gt; &lt; span &gt;&lt;/ span &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox" name = "attr_Discipline" value = "3" /&gt; &lt; span &gt;&lt;/ span &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox" name = "attr_Discipline" value = "4" /&gt; &lt; span &gt;&lt;/ span &gt; &lt; input type = "radio" class = "sheet-defaultRadioBox" name = "attr_Discipline" value = "5" /&gt; &lt; span &gt;&lt;/ span &gt; &lt;/ div &gt; &lt; button class = "sheet-diebutton-api" title = "Rolls Rouse" type = 'roll' name = 'roll_rouseApi' value = '!vtm rouse t~Rouse ~ c~@{name} ~' &gt;&lt;/ button &gt; &lt; button class = "sheet-diebutton-simple" type = "roll" title = "Non-API Rouse Roll" value = "&amp;{template:wod} {{name= @{name}}} {{Rollname=Rouse}} {{HungerSuccesses=[[1d10&gt;6 ]]}} {{HungerDice=1}}" name = "roll_rouseInlineDice" &gt;&lt;/ button &gt; &lt; select name = "attr_DPAtt" style = " width:110px; margin: 0 10px 0 10px; display:inline-block" &gt; &lt; option value = "0" selected &gt;&lt;/ option &gt; &lt; option value = "@{Strength}" data-i18n = "strength-u" &gt; Strength &lt;/ option &gt; &lt; option value = "@{Dexterity}" data-i18n = "dexterity-u" &gt; Dexterity &lt;/ option &gt; &lt; option value = "@{Stamina}" data-i18n = "stamina-u" &gt; Stamina &lt;/ option &gt; &lt; option value = "@{Charisma}" data-i18n = "charisma-u" &gt; Charisma &lt;/ option &gt; &lt; option value = "@{Manipulation}" data-i18n = "manipulation-u" &gt; Manipulation &lt;/ option &gt; &lt; option value = "@{Composure}" data-i18n = "composure-u" &gt; Composure &lt;/ option &gt; &lt; option value = "@{Intelligence}" data-i18n = "intelligence-u" &gt; Intelligence &lt;/ option &gt; &lt; option value = "@{Wits}" data-i18n = "wits-u" &gt; Wits &lt;/ option &gt; &lt; option value = "@{Resolve}" data-i18n = "resolve-u" &gt; Resolve &lt;/ option &gt; &lt;/ select &gt; &lt; select name = "attr_DPAbi" style = " width:110px; margin: 0 10px 0 0; display:inline-block" &gt; &lt; option value = "0" selected &gt;&lt;/ option &gt; &lt; option value = "@{Discipline}" &gt; Discipline &lt;/ option &gt; &lt; option value = "@{Academics}" data-i18n = "academics-u" &gt; Academics &lt;/ option &gt; &lt; option value = "@{AnimalKen}" data-i18n = "animalken-u" &gt; Animal Ken &lt;/ option &gt; &lt; option value = "@{Athletics}" data-i18n = "athletics-u" &gt; Athletics &lt;/ option &gt; &lt; option value = "@{Awareness}" data-i18n = "awareness-u" &gt; Awareness &lt;/ option &gt; &lt; option value = "@{Brawl}" data-i18n = "brawl-u" &gt; Brawl &lt;/ option &gt; &lt; option value = "@{Craft}" data-i18n = "craft-u" &gt; Craft &lt;/ option &gt; &lt; option value = "@{Drive}" data-i18n = "drive-u" &gt; Drive &lt;/ option &gt; &lt; option value = "@{Etiquette}" data-i18n = "etiquette-u" &gt; Etiquette &lt;/ option &gt; &lt; option value = "@{Finance}" data-i18n = "finance-u" &gt; Finance &lt;/ option &gt; &lt; option value = "@{Firearms}" data-i18n = "firearms-u" &gt; Firearms &lt;/ option &gt; &lt; option value = "@{Insight}" data-i18n = "insight-u" &gt; Insight &lt;/ option &gt; &lt; option value = "@{Intimidation}" data-i18n = "intimidation-u" &gt; Intimidation &lt;/ option &gt; &lt; option value = "@{Investigation}" data-i18n = "investigation-u" &gt; Investigation &lt;/ option &gt; &lt; option value = "@{Larceny}" data-i18n = "larceny-u" &gt; Larceny &lt;/ option &gt; &lt; option value = "@{Leadership}" data-i18n = "leadership-u" &gt; Leadership &lt;/ option &gt; &lt; option value = "@{Medicine}" data-i18n = "medicine-u" &gt; Medicine &lt;/ option &gt; &lt; option value = "@{Melee}" data-i18n = "melee-u" &gt; Melee &lt;/ option &gt; &lt; option value = "@{Occult}" data-i18n = "occult-u" &gt; Occult &lt;/ option &gt; &lt; option value = "@{Performance}" data-i18n = "performance-u" &gt; Performance &lt;/ option &gt; &lt; option value = "@{Persuasion}" data-i18n = "persuasion-u" &gt; Persuasion &lt;/ option &gt; &lt; option value = "@{Politics}" data-i18n = "politics-u" &gt; Politics &lt;/ option &gt; &lt; option value = "@{Science}" data-i18n = "science-u" &gt; Science &lt;/ option &gt; &lt; option value = "@{Stealth}" data-i18n = "stealth-u" &gt; Stealth &lt;/ option &gt; &lt; option value = "@{Streetwise}" data-i18n = "streetwise-u" &gt; Streetwise &lt;/ option &gt; &lt; option value = "@{Subterfuge}" data-i18n = "subterfuge-u" &gt; Subterfuge &lt;/ option &gt; &lt; option value = "@{Survival}" data-i18n = "survival-u" &gt; Survival &lt;/ option &gt; &lt; option value = "@{Technology}" data-i18n = "technology-u" &gt; Technology &lt;/ option &gt; &lt;/ select &gt; &lt; button class = "sheet-diebutton-api" title = "Discipline Roll" type = 'roll' style = " vertical-align: top;" name = 'roll_DProllApi' value = '!vtm skill r@{Hunger} a@{DPAtt} s@{DPAbi} m?{Modifiers|0} b@{BloodPotency} t~@{DisciplineName} ~ c~@{name} ~' &gt;&lt;/ button &gt; &lt; button class = "sheet-diebutton-simple" type = "roll" title = "Non-API Discipline Roll" style = " vertical-align: top;" value = "&amp;{template:wod} {{name= @{name}}} {{Rollname=@{DisciplineName}}} {{NormalSuccesses=[[ [[((([[ [[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{hunger} ]] ]]) + abs([[ [[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{hunger} ]] ]])) / 2)]]d10&gt;6 ]]}} {{HungerSuccesses=[[ [[((([[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] + @{hunger}) - abs([[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] - @{hunger})) / 2)]]d10&gt;6]]}} {{NormalDice=[[ ((([[ [[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{hunger} ]] ]]) + abs([[ [[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{hunger} ]] ]])) / 2) ]]}} {{HungerDice=[[((([[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] + @{hunger}) - abs([[@{DPAtt} + @{DPAbi} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] - @{hunger})) / 2)]]}}" name = "roll_disciplineInlineDice" &gt; &lt;/ button &gt; &lt;/ div &gt; &lt; h4 style = " display:inline-block; margin-left: 395px" &gt; Powers &lt;/ h4 &gt; &lt; input type = "checkbox" class = "sheet-arrowBox" style = " display:inline-block;" /&gt; &lt; span &gt;&lt;/ span &gt; &lt; div style = " text-align: left;" class = "sheet-arrowBox" &gt; &lt; div style = " text-align: left;" &gt; &lt; div style = " text-align: left; margin-left: 100px; " &gt; &lt; input type = "text" name = "attr_DisciplinePowerName1" style = " width:300px; display:inline-block" /&gt; &lt; button class = "sheet-diebutton-api" title = "Rolls Rouse" type = 'roll' name = 'roll_rouseApi' value = '!vtm rouse t~Rouse ~ c~@{name} ~' &gt;&lt;/ button &gt; &lt; button class = "sheet-diebutton-simple" type = "roll" title = "Non-API Rouse Roll" value = "&amp;{template:wod} {{name= @{name}}} {{Rollname=Rouse}} {{HungerSuccesses=[[1d10&gt;6 ]]}} {{HungerDice=1}}" name = "roll_rouseInlineDice" &gt;&lt;/ button &gt; &lt; select name = "attr_DPPowerAtt1" style = " width:110px; margin: 0 10px 0 10px; display:inline-block" &gt; &lt; option value = "0" selected &gt;&lt;/ option &gt; &lt; option value = "@{Strength}" data-i18n = "strength-u" &gt; Strength &lt;/ option &gt; &lt; option value = "@{Dexterity}" data-i18n = "dexterity-u" &gt; Dexterity &lt;/ option &gt; &lt; option value = "@{Stamina}" data-i18n = "stamina-u" &gt; Stamina &lt;/ option &gt; &lt; option value = "@{Charisma}" data-i18n = "charisma-u" &gt; Charisma &lt;/ option &gt; &lt; option value = "@{Manipulation}" data-i18n = "manipulation-u" &gt; Manipulation &lt;/ option &gt; &lt; option value = "@{Composure}" data-i18n = "composure-u" &gt; Composure &lt;/ option &gt; &lt; option value = "@{Intelligence}" data-i18n = "intelligence-u" &gt; Intelligence &lt;/ option &gt; &lt; option value = "@{Wits}" data-i18n = "wits-u" &gt; Wits &lt;/ option &gt; &lt; option value = "@{Resolve}" data-i18n = "resolve-u" &gt; Resolve &lt;/ option &gt; &lt;/ select &gt; &lt; select name = "attr_DPPowerAbi1" style = " width:110px; margin: 0 10px 0 0; display:inline-block" &gt; &lt; option value = "0" selected &gt;&lt;/ option &gt; &lt; option value = "@{Discipline}" &gt; Discipline &lt;/ option &gt; &lt; option value = "@{Academics}" data-i18n = "academics-u" &gt; Academics &lt;/ option &gt; &lt; option value = "@{AnimalKen}" data-i18n = "animalken-u" &gt; Animal Ken &lt;/ option &gt; &lt; option value = "@{Athletics}" data-i18n = "athletics-u" &gt; Athletics &lt;/ option &gt; &lt; option value = "@{Awareness}" data-i18n = "awareness-u" &gt; Awareness &lt;/ option &gt; &lt; option value = "@{Brawl}" data-i18n = "brawl-u" &gt; Brawl &lt;/ option &gt; &lt; option value = "@{Craft}" data-i18n = "craft-u" &gt; Craft &lt;/ option &gt; &lt; option value = "@{Drive}" data-i18n = "drive-u" &gt; Drive &lt;/ option &gt; &lt; option value = "@{Etiquette}" data-i18n = "etiquette-u" &gt; Etiquette &lt;/ option &gt; &lt; option value = "@{Finance}" data-i18n = "finance-u" &gt; Finance &lt;/ option &gt; &lt; option value = "@{Firearms}" data-i18n = "firearms-u" &gt; Firearms &lt;/ option &gt; &lt; option value = "@{Insight}" data-i18n = "insight-u" &gt; Insight &lt;/ option &gt; &lt; option value = "@{Intimidation}" data-i18n = "intimidation-u" &gt; Intimidation &lt;/ option &gt; &lt; option value = "@{Investigation}" data-i18n = "investigation-u" &gt; Investigation &lt;/ option &gt; &lt; option value = "@{Larceny}" data-i18n = "larceny-u" &gt; Larceny &lt;/ option &gt; &lt; option value = "@{Leadership}" data-i18n = "leadership-u" &gt; Leadership &lt;/ option &gt; &lt; option value = "@{Medicine}" data-i18n = "medicine-u" &gt; Medicine &lt;/ option &gt; &lt; option value = "@{Melee}" data-i18n = "melee-u" &gt; Melee &lt;/ option &gt; &lt; option value = "@{Occult}" data-i18n = "occult-u" &gt; Occult &lt;/ option &gt; &lt; option value = "@{Performance}" data-i18n = "performance-u" &gt; Performance &lt;/ option &gt; &lt; option value = "@{Persuasion}" data-i18n = "persuasion-u" &gt; Persuasion &lt;/ option &gt; &lt; option value = "@{Politics}" data-i18n = "politics-u" &gt; Politics &lt;/ option &gt; &lt; option value = "@{Science}" data-i18n = "science-u" &gt; Science &lt;/ option &gt; &lt; option value = "@{Stealth}" data-i18n = "stealth-u" &gt; Stealth &lt;/ option &gt; &lt; option value = "@{Streetwise}" data-i18n = "streetwise-u" &gt; Streetwise &lt;/ option &gt; &lt; option value = "@{Subterfuge}" data-i18n = "subterfuge-u" &gt; Subterfuge &lt;/ option &gt; &lt; option value = "@{Survival}" data-i18n = "survival-u" &gt; Survival &lt;/ option &gt; &lt; option value = "@{Technology}" data-i18n = "technology-u" &gt; Technology &lt;/ option &gt; &lt;/ select &gt; &lt; button class = "sheet-diebutton-api2" title = "Discipline Roll" type = 'roll' style = " vertical-align: top;" name = 'roll_DPPowerrollApi1' value = '!vtm skill r@{Hunger} a@{DPPowerAtt1} s@{DPPowerAbi1} m?{Modifiers|0} b@{BloodPotency} c~@{name} ~ t~@{DisciplinePowerName1}~' &gt; &lt;/ button &gt; &lt; button class = "sheet-diebutton-simple2" type = "roll" title = "Non-API Discipline Roll" style = " vertical-align: top;" value = "&amp;{template:wod} {{name= @{name}}} {{Rollname=@{DisciplinePowerName1}}} {{NormalSuccesses=[[ [[((([[ [[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{Hunger} ]] ]]) + abs([[ [[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{Hunger} ]] ]])) / 2)]]d10&gt;6 ]]}} {{HungerSuccesses=[[ [[((([[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] + @{Hunger}) - abs([[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] - @{Hunger})) / 2)]]d10&gt;6]]}} {{NormalDice=[[ ((([[ [[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{Hunger} ]] ]]) + abs([[ [[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]]- [[ @{Hunger} ]] ]])) / 2) ]]}} {{HungerDice=[[((([[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] + @{Hunger}) - abs([[@{DPPowerAtt1} + @{DPPowerAbi1} + floor([[@{BloodPotency}]]/2.0) +?{Modifiers|0} ]] - @{Hunger})) / 2)]]}}" name = "roll_DPPowerrollInline1" &gt; &lt;/ div &gt; &lt; div style = " text-align: left; margin-left: 60px; margin-top: 5px;" &gt; &lt; h4 style = " width:60px; display:inline-block" &gt; Details &lt;/ h4 &gt; &lt; input type = "text" name = "attr_DisciplinePowerDetails1" style = " width:535px; display:inline-block" /&gt; &lt; h4 style = " width:60px; display:inline-block" &gt; Display &lt;/ h4 &gt; &lt; button type = "roll" title = "Print Details" value = "&amp;{template:wod} {{name= @{name}}} {{Rollname=@{DisciplinePowerName1}}} {{DisciplineDetails=@{DisciplinePowerDetails1}}}" name = "roll_rouseInlineDice" &gt;&lt;/ button &gt; &lt;/ div &gt; &lt;/ div &gt; &lt;/ div &gt; &lt;/ fieldset &gt; &lt;/ div &gt;
1537907313
Finderski
Pro
Sheet Author
Compendium Curator
Bad news...can't have nested fieldsets...that's why it isn't working for you. &nbsp;It would be a nice feature though.&nbsp;
Curses. Thanks for taking the time to reply. I'll make do with just having 5 instances. My inner code monkey is going to grimace 😄
1537911166
Finderski
Pro
Sheet Author
Compendium Curator
I know the feel...I had to do some creative stuff for one of my sheets...Is there a maximum number of disciplines one could have? &nbsp;If so, you could make that number of disciplines with a fields for each for the powers. &nbsp;To keep the sheet somewhat clean, you can hide those extra disciplines and make them revealable similar to a fields...meaning, you create some checkboxes look like buttons to add and remove those disciplines. &nbsp;It's a lot of work but does make the sheet look a little slicker... Or you could just create a configurations section to show more disciplines. &nbsp;Of course, that kind of falls apart if one could have an unlimited number of disciplines. :-/
I considered the first option. There isn't really a limit to disciplines but there are to powers. I think it will do for now till the rules change 😁 The configuration section is a nice idea, I'll keep that in mind if there needs to be more updates later. Thanks again