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

CHECKBOX TO SHOW REPEATING FIELDSETS CONTAINING CHECKBOXES AND FIELDSETS.

May 31 (2 years ago)

Edited May 31 (2 years ago)

---

---


Hey there, I need some help about this part of my custom sheet.
This is my skill book.
I have this "Habilidades" section, I also have that first checkbox to show its containing (box 1).
So, I have a blank input to name a class and another checkbox to show those inputs below it (box 2).


I want to create a fieldset with that input before box 2, but I also want that new field to expand when the box is checked.
So, it's like a repeating fieldset, and if the box 2 is checked, shows another repeating fieldset with those inputs.


I can't make it work, and I don't know what is wrong.
It's like they are all the same. If I write something there, it shows on all of them.

If I add another section, it disapears.

This is my code:

Thanks

<div>  
<hr><hr>
<div style="margin-left: 30px">
<label style="margin-top: 20px; margin-bottom: 30px; width: 320px; font-size: 50px">Habilidades</label>
<input type=checkbox name="attr_showshab" class=showsaptidoes value=1 />
<div class=aptidoesblock>
<fieldset class=repeating_actions>
<div class=weaponsblock>
<input class=medium name=attr_classname></input><input type=checkbox name="attr_showsclasshab" class=showthiefabilities value=1 />
<div class=thiefabilitiesblock>
<fieldset class=repeating_weapons>
<div class=weaponsblock style="margin-top: 10px; margin-bottom: 3px">
<span style="margin-bottom: 5px"><input style="width: 300px" class='wide' type=text name=attr_habname /></span>
<br>
<label>Tipo</label>
<span class='narrow' style="width: 90px">
<select class=narrow name="attr_habtype" style="width: 75px">
<option>Ativa</option>
<option>Reativa</option>
<option>Suporte</option>
<option>Movimento</option>
</select>
</span>
<label>Classe</label>
<span class='narrow' style="width: 150px">
<input name="attr_habclass" type=text class='narrow' />
</span>
<button type=roll value="&{template:default} {{name=@{habname}}} {{*Tipo:*= ``@{habtype}``}} {{*Classe:*= *@{habclass}*}} {{*Descrição:*=
``@{habdescr}``}}"></button></span>
<textarea style="height: 50px; width: 100%; margin-bottom: 3px" class=wide name="attr_habdescr"></textarea>
<hr style="margin-left: 75px; width: 80%; margin-bottom: 5px; margin-top: 5px">
</div></fieldset>
</div>
</div></fieldset>
</div>
</div>
</div>


May 31 (2 years ago)
GiGs
Pro
Sheet Author
API Scripter

I'm not sure exactly what you're ater here because reading the code isn't easy, but I do notice a lack of quotes, For instance, this:

<input type=checkbox name="attr_showsclasshab" class=showthiefabilities value=1 />

should be

<input type="checkbox" name="attr_showsclasshab" class="showthiefabilities" value="1" />


Put all your classes, values, names, and types inside quotation marks. You can use " or '.

May 31 (2 years ago)

Edited May 31 (2 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

You are trying to nest repeating sections. This is not possible and causes all sorts of weirdness. Can you explain what you're trying to do a little more? There should be a way to do it, we just need to change from this method.


EDIT: And seconding the code styling issues that GiGs mentioned.

May 31 (2 years ago)

Edited May 31 (2 years ago)

GiGs said:

I'm not sure exactly what you're ater here because reading the code isn't easy, but I do notice a lack of quotes, For instance, this:

<input type=checkbox name="attr_showsclasshab" class=showthiefabilities value=1 />

should be

<input type="checkbox" name="attr_showsclasshab" class="showthiefabilities" value="1" />


Put all your classes, values, names, and types inside quotation marks. You can use " or '.

Thanks, I'll do it.
I'm not used to code, I'm sorry about that.
I just know how to edit some simple codes.


On "Habilidades" section of my sheet, I'm just using something that works fine for my "Inventário" section, but there I don't have any checkboxes inside it.


May 31 (2 years ago)

Edited May 31 (2 years ago)
Scott C. said:

You are trying to nest repeating sections. This is not possible and causes all sorts of weirdness. Can you explain what you're trying to do a little more? There should be a way to do it, we just need to change from this method.


EDIT: And seconding the code styling issues that GiGs mentioned.


Sorry about quotations marks, I'm not an IT professional, my programming knowledge is very basic.

I just want to make sure things are organized on my sheet and working.

I have my skills section, but to put a skill on the list, I need to know which RPG class it belongs to, because on my RPG players can learn from any class.

So I think it's better to organize the classes before listing the skills, as if each RPG class was a subheading.

With that, I would like a hierarchy, something that works like tabs or something that expands and collapses for easy viewing and navigation.

Something like this:




SKILLS > CLASS > SKILL LIST

SKILLS This is the skills section as a whole, which is shown with the first checkbox.

CLASS is about which class that skill belongs to, then organize them in the same list.

SKILL LIST is the list of each skill, which must be grouped under the CLASS subheading.

The CLASS
subheading must be and input and needs to be repeatable, I need to be able to create others like it by clicking "add". And each new field generated must contain its own SKILL LIST when expanded.

I hope I was able to better explain what I'm trying to do.

Thanks!

May 31 (2 years ago)

Edited May 31 (2 years ago)
GiGs
Pro
Sheet Author
API Scripter

As Scott says, nesting repeating sections is a no-no. Don't try to put a fieldset inside a fieldset.

If players are to pick a class for each skill, this is best done in one of three ways, I think.

  • If the names of all the classes are known, create a select (dropdown list) where each class is one option.
  • If the names of all classes are not known, you can use the same version with an option list/ This uses an input instead of a select, and you need to create the default list of classes but players can enter their own. This list is unique to each character-  not shared among all character sheets.
  • If you select the class once and it applies to all skills of a characterm, create a position somewhere else in the sheet - it can use either method above.

You'll find information and examples here: https://cybersphere.me/choosing-from-a-list-select-datalist/


If you want to create separate classes, each of which have their own sets of skills, you really cant do that on Roll20. But if you can use mutltiple selects and or optlists - separate ones for each class, and use CSS to show the relevant ones.

June 02 (2 years ago)

Edited June 02 (2 years ago)

GiGs said:

As Scott says, nesting repeating sections is a no-no. Don't try to put a fieldset inside a fieldset.

If players are to pick a class for each skill, this is best done in one of three ways, I think.

  • If the names of all the classes are known, create a select (dropdown list) where each class is one option.
  • If the names of all classes are not known, you can use the same version with an option list/ This uses an input instead of a select, and you need to create the default list of classes but players can enter their own. This list is unique to each character-  not shared among all character sheets.
  • If you select the class once and it applies to all skills of a characterm, create a position somewhere else in the sheet - it can use either method above.

You'll find information and examples here: https://cybersphere.me/choosing-from-a-list-select-datalist/


If you want to create separate classes, each of which have their own sets of skills, you really cant do that on Roll20. But if you can use mutltiple selects and or optlists - separate ones for each class, and use CSS to show the relevant ones.

Hey GiGs!

Thanks for you help.

I got a bit confused about that stuff you sent me, I couldn't handle it, sorry.

But now I have all my quotes set and I solved my problem with checkboxes!

I know it's not the most elegant solution, but that's what I was able to do and it works!

I created 19 checkboxes with repeating fieldsets inside each, so now I have my lists organized!

And I also have an input for each class to store the class points (PA) individually.




June 02 (2 years ago)

Edited June 02 (2 years ago)
GiGs
Pro
Sheet Author
API Scripter

I'm probably not understanding what you want (in fact I know that's the case, ignore the probably :) ), because 19 fieldsets seems like overkill to me, but congratulations on getting where you want.