TW5 Data Entry Form

119 views
Skip to first unread message

Reaktorblue

unread,
Apr 12, 2021, 10:28:48 AM4/12/21
to TiddlyWiki
I'm trying to learn how to use TW5 as a way to document some things via a data entry form

I have these two tiddlers created
  • Basic Form
  • $:/state/basic-form
In the Basic Form tiddler, I'm using a button to create a new tiddler based on the data in the form

\define newEntry()
<$action-createtiddler $basetitle="entry" $template="$:/state/basic-form"/>
\end

<$button actions=<<newEntry>> >
Create Tiddler
</$button>

Is there a way to also clear the form once I have clicked the button?


Joshua Fontany

unread,
Apr 12, 2021, 7:48:22 PM4/12/21
to TiddlyWiki
Yes, see below. This will work as long as your State tiddler only holds data (that can then be re-entered using the Form tiddler).

Good work exploring TW UI! :)

```
\define newEntry()
<$action-createtiddler $basetitle="entry" $template="$:/state/basic-form"/>
<$action-deletetiddler $tiddler="$:/state/basic-form"/>
\end

<$button actions=<<newEntry>> >
Create Tiddler
</$button>
```

If you want to clear selective fields, while leaving others intact, use the $action-deletefield (which is identical to using the $action-setfield widget with NO value).


Best,
Joshua Fontany

Mohammad Rahmani

unread,
Apr 12, 2021, 11:36:12 PM4/12/21
to tiddl...@googlegroups.com
While Joshua gave you the right direction you can have a look at the dictionary project by Jed Carty (he has a lot of great examples, and case studies)
from TW-Scripts


TW-scripts has not been updated for a while, but it is among the very useful TW scripting resources in the whole galaxy ;-) :-) :-) that is because many people from TW community contributed to that!




Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e69ea84e-3cb6-4c71-bb4c-2a362cfaeba1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages