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

Quick question on creating sheets...

Is the class "sheet-inputbox" what makes what ever is in the field into a field in the attributes panel? And that the name in this example will make the field name attr_str? <input class="sheet-inputbox" type="number" name="attr_str">
1401393742
Lithl
Pro
Sheet Author
API Scripter
No. If the name begins with "attr_", that's what makes the value into an Attribute. In your example, you'd have an attribute named "str", and you could use input.sheet-inputbox as a selector in your CSS to apply styles to it.
1401394764

Edited 1401394942
So if I apply this sheet in my game anything with attr_ gos to the attribute sheet?
I just answered my own question. Instead of posting about it, I should have just checked in roll20 first (which I just did) to find out that is indeed how it works. At least I hope others delving into creating sheets learned from this. :)
1401395419
Lithl
Pro
Sheet Author
API Scripter
I'm not sure what you're asking. If the character sheet has your sample input field: A new character will not have an attribute "str", and the input field will be empty*. The player can increment, decrement, or set the field value as they please**; once they move the focus of the browser out of the field, the character will have an attribute "str" with the appropriate value. Changing the attribute "str" on the Attributes & Abilities page, or changing the "attr_str" field on the character sheet (and then changing the browser's focus to anything else) will change the character's "str"***. Once you create the CSS for the character, sheet, one of the possible selectors you could use to style the input field would be input.sheet-inputbox . * You can add value="0" (or any other number) to the input to give it a default value. The character still won't have a "str" attribute until you change it, but the field won't appear empty, and the API will be able to get that default value with getAttrByName . ** By default, there is no minimum or maximum to a number field. You can specify both with min="..." and max="..." , respectively. The user won't be able to set the value below the minimum or above the maximum. *** While the user won't be able to put a non-numeric value into the number input field, you can put strings into attributes. I'm not certain what the input field will do if you edit the attribute to be a non-numeric value...
Oh, what is the type for the arrow selections? The wiki only mentions text, number, checkbox, radio, and textarea types. I've seen these on other sheets, but I can't remember which one.
1401396262

Edited 1401396500
Lithl
Pro
Sheet Author
API Scripter
If you mean the inputs which have an up/down arrow to select a number, that's type="number" . text : single line of text number : number, with up/down arrows. Some older browsers might not support this, and will default to text if they don't checkbox : on or off state radio : on or off state, and only one radio in a group can be on at any given time; a group is defined by the name attribute of the input (all radios with the same name are part of the same group) textarea : multiple lines of text Don't forget that there's also select , which lets you create a dropdown list. text , number , checkbox , and radio are all types for the input element (there are others defined in HTML, but I'm not sure which will work on character sheets). textarea and select are their own elements.
1401396598

Edited 1401396887
Ah, that's what number is. Ok, I see. I know about select, I have it used for the Alignment, Class and Race options on my sheet. When using type="number" and value="10" I still don't get the arrows to adjust the value.
1401403849
Lithl
Pro
Sheet Author
API Scripter
Hmm. What's the HTML for your input look like, and what browser/version are you running?
1401413822

Edited 1401414742
EDIT: Yes, it was waterfox, I ran it in Chrome and I see all the arrows now.