Hi,
I'm working on building character sheets for tokens.
I was wanting to have a tab which is just a big editable notes field where players can enter large amounts of extra info that does not have specific fields on the other character sheet tabs.
I assumed the best place to store this would be the Tokens "Notes" field.
So first I am unsure of how to access the notes field.
I'm also not sure how to make an editable text box within a frame.
Currently I have links to input macros to update fields.
I'm happy to do that here but still don't know how to load multiline inputs.
Any thoughts?
Templar
Can you load token Notes into an editable Frame?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Can you load token Notes into an editable Frame?
In theory you could use the textarea html tag in a form but I don't know if the subset of HTML that is supported by Java includes textarea.
See the wiki page Introduction_to_Dialogs_and_Frames for an example of using html forms in dialogs.
See the wiki page Introduction_to_Dialogs_and_Frames for an example of using html forms in dialogs.
- bubblobill
- Giant
- Posts: 167
- Joined: Sun Jan 24, 2010 3:07 pm
Re: Can you load token Notes into an editable Frame?
Yes, you can use the textarea form input type.
Try using something like this
Because people can have absolutely anything in their notes, you will need to clean/replace characters that will trip up the HTML, stripping out HTML tags and replacing " & ' should be enough generally.
Try using something like this
Spoiler
Code: Select all
[h: tokID=currentToken()]
[h: switchToken(tokID)]
[h: tokNotes=encode(getNotes())]
<!-- you need to clean the note text here to prevent unpleasant results. -->
[h: css='
<style>
<!--css goes here-->
th {background-color:#CC32EE;
color:#FFFFEE;}
</style>']
[h: processorLink = macroLinkText("form.process@token","self","",currentToken())]
[h: updateButton='<input type="submit" name="update" value="Update Token">']
[h: notesTextArea='<textarea name="tokenNotes" cols= "89" rows="36">'+decode(tokNotes)+'</textarea>']
[h: frameHTML=strformat('
<html>
<head>
<title>Edit Token Notes</title>
%{css}
</head>
<form action="%{processorLink}" method="json" >
<input type="hidden" name="stored.args" value=macro.args>
<table width=100%>
<tr><th width=100% align=center>Your tab links/images/cells/whatever here.</th></tr>
<tr><td align=right>%{updateButton}</td></tr>
<tr><td align=center>%{notesTextArea}</td></tr>
</table>
</form>
</html>')]
[r,frame("MyFrameName", "width=300; height=700; temporary=0;"): {[r:frameHTML]}]
Bubblobill on the forum.
@Reverend on the MapTool Discord Server
Responsible for less atrocities than most... I do accept responsibility for these though: SmartDoors, Simple d20 Framework - barebones, Drop-in: All 3.5 SRD Monsters, Drop in: Simple Character Editor, Battletech Framework
@Reverend on the MapTool Discord Server
Responsible for less atrocities than most... I do accept responsibility for these though: SmartDoors, Simple d20 Framework - barebones, Drop-in: All 3.5 SRD Monsters, Drop in: Simple Character Editor, Battletech Framework