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

HTML Help

1677083465

Edited 1677083634
Can anyone tell me is there a way to make a text line in HTML that requires some type of key word to change the text.  Example If I want to cheat proof the EXP line or say Wealth or whatever. The  text box label would be like  Total EXP and then a text entry. Example: Is there a way to code the text so if I was going to enter the change 500 to 1000  the actual entry would have to be keyword1000  and it would show up 1000
1677084272
The Aaron
Roll20 Production Team
API Scripter
First off, are you talking about in a Character Sheet, or in some output from an Mod Script? In either case, validation would need to take place after the entry is made. In a Character Sheet, you'd use a Sheet Worker triggered on the change event for the field to look at the prior value and the entered value, and revert or adjust the value.  For a mod Script, there isn't a way to do input as a text box in HTML, you'd take it on the command line, or via a Roll Query (which is just syntactic sugar for a command line entry), then you'd do whatever you want with the supplied value in the script.
1677085175

Edited 1677085409
Thanks, are you aware of such at thing in a preexisting HTML character sheet that has been made that I could find it Github? I have taught myself what I know in HTML through trial and error so doing it from scratch for me would be very difficult.  
1677085400
The Aaron
Roll20 Production Team
API Scripter
Character sheets are pretty unlike other webpages.&nbsp; The HTML is the same, but the way you interact with Javascript is quite a bit different. I'd suggest the starting here:&nbsp; <a href="https://wiki.roll20.net/Building_Character_Sheets" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets</a> Specifically, you're looking for sheet workers, which are embedded javascript functionality driven by events on the sheet.
Thanks so much!
1677085465

Edited 1677085511
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'm not aware of any sheet that does this exactly. However, there are many sheets that use sheetworkers for a wide variety of things. Before diving into that though, I'd recommend learning some basics of javascript. There are several course/reference options online like codecademy. EDIT: and Aaron is right, get to grips with the unique qualities of Roll20 sheetworkers.
Thanks also. I have made my own sheets that are working well and taught myself a good bit but have kept them within my understanding thus far. This is beyond where I have gone so it seems to get to more advanced stuff I need to do some more research.&nbsp;