We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement Create a free account

Do checkboxes/forms work for API?

1517152486

Edited 1517152493
Figured I would ask before I started on this in case someone else had experience with this. Not to mention one of The Aaron's primary advice for scripts is to figure out the UI. So I am wanting to print out a list of items that the player can pick as many of the items they want, and then click a submit button. Do HTML forms work in the chat window if they are output by the API?
1517153316

Edited 1517157476
Scott C.
Forum Champion
Sheet Author
API Scripter
Not that I'm aware of. That would make a lot of things easier tho. EDIT (Now that I'm not on mobile): The way I would handle this (learned from Aaron of course), is to have the script generate(and store) a unique code each time it sends a fresh menu. Then each "checkbox" would actually be an API command button that would send the info from that "checkbox" to the script tagged with the unique code of that set of menus. The script would store the input in an object indexed by codes, and then output a new menu, with the same code, to chat that indicates that option has been selected. Once the user is done selecting options, they'd click the "submit" button, which would again be an API command button, and send the execute command to the script which would take all the options saved in the object and use them as appropriate.