The below code uses a button to create more input boxes to get
field-name/field-value pairs from user.
It then will be used to create a tiddler with many fields as user like!
This works, but it seems a bit complicated!
What do you propose?
\define myTid() xx$:/temp/sample
\define myfilter() [range[1,$(flt)$]]
\define id_fldName() fldn$(cnt)$
\define id_fldValue() fldv$(cnt)$
\define create-recoreds()
<$wikify name=flt text={{{ [<myTid>get[counter]]~[[1]] }}}>
<$list filter=<<myfilter>> variable=cnt>
<<getInputs>>
</$list>
</$wikify>
\end
\define getInputs()
<$edit-text tiddler=<<myTid>> index=<<id_fldName>> tag=input default=""
placeholder="field name"/>
<$edit-text tiddler=<<myTid>> index=<<id_fldValue>> tag=input default=""
placeholder="field value"/>
\end
<$button>add
<$action-setfield $tiddler=<<myTid>>
counter={{{[<myTid>get[counter]add[1]]~[[2]]}}}/>
</$button>
<$button>reset
<$action-setfield $tiddler=<<myTid>> counter="1"/>
<$action-setfield $tiddler=<<myTid>> text=""/>
</$button>
Number of records: <$count filter="[<myTid>indexes[]]" /><br>
Counter: <$transclude tiddler=<<myTid>> field="counter"/><br>
<<create-recoreds>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/d818f270-9426-4827-bd0a-6d69e0436b66%40googlegroups.com.