Added to TW-Scripts
On Friday, April 17, 2020 at 7:23:05 PM UTC+4:30, Eric Shulman wrote:
>
> On Friday, April 17, 2020 at 5:32:44 AM UTC-7, si wrote:
>>
>> I'm specifically trying to set a timestamp every time I use the radio
>> widget to change the value of a field.
>> The only thing I can think of currently is to create my own radio widget
>> functionality with buttons and the reveal widget. Maybe there is an easier
>> solution?
>>
>
> You do need to use a $button widget, but don't need to use the $reveal
> widget. Here's a working example (tested on TiddlyWiki.com)
> \define set_timestamp() <$action-setfield timestamp=<<now
> YYYY0MM0DD0hh0mm0ss0XXX>> />
>
> <$button class="tc-btn-invisible" actions=<<set_timestamp>>>
> <$radio field="choice" value="one"> one </$radio>
> <$radio field="choice" value="two"> two</$radio>
> <$radio field="choice" value="three"> three </$radio>
> </$button>
>
> choice = {{!!choice}}, timestamp = {{!!timestamp}}
> The $radio widgets show/set the current choice, but the timestamp is set
> by the surrounding $button widget.
>
> Let me know how it goes.
>
> enjoy,
> -e
>
> note: edited to simplify the code even further
>
--
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/c2365384-685c-4862-9f28-ef98f8703f78%40googlegroups.com.