Right before christmas i managed to google some things together. my goal is a tiddler with some form elements (textarea, dropdown,etc) and a button who creates tiddlers (and fills custom fields of that tiddler) based on the input of the form.
so far i have this, but i don´t now how to manage that all the tiddler name which will be created based on the “name_temp” field, gets a “_table” concencated at the end of the name_temp field
There’s a small syntax error in Mark’s reply… an extra “}”… it should be: <$action-setfield $tiddler={{{ [{$:/state/NewTiddlerForm!!name_temp}addsuffix[_table]] }}} ...
There also seems to be an unneeded </$wikify>at the end of your posted code.
Use a macro (e.g. \define form() ...) to set a variable containing the title of the input tiddler (i.e., $:/state/NewTiddlerForm). This allows you to refer to <<form>> instead of hard-coding the input tiddler’s title in multiple places. This makes your code more compact and more readable, and also makes it easier to change the input tiddler’s title later on if you want/need to.
Use $action-createtiddler instead of $action-setfield, so that if you enter the same title more than once, it will automatically add a number suffix to the resulting tiddler title (i.e., foo_table, foo_table 1, foo_table 3, etc.).
Enclose the $action-createtiddler within a $tiddler widget so that the field references don’t need to include the form tiddler title (i.e., just {{!!label}}, {{!!url}}, etc.)
Using $action-createtiddler also enables reference to <<createTiddler-title>> inside the widget to navigate to the newly created tiddler title.
Use $action-deletetiddler instead of $action-setfield to reset the form inputs. This will completely remove the $:/state/NewTiddlerForm, so that the inputs revert to showing their placeholder values, instead of being empty.
well thank you @EricShulman that code seems more like it and it also fits my requirement.
i barely understand half of what the code does, but for me it is a good point of refernce to untanngle it bit by bit to get a more thorough understanding of the tiddlywiki concept (coming from python and javascript)