On Saturday, June 6, 2020 at 9:56:08 AM UTC-7, Damon Pritchett wrote:
>
> I like the idea of the submit button, but am unsure as to how to implement 
> that. I know I need to couple a button with an action widget, but the 
> documentation at Tiddlywiki.com is confusing to me. Could you point me to 
> an example?
>

Try this:
<$edit-text tag="input" tiddler="$:/temp/mysearch/input" default="" 
placeholder="enter search text" />
<$button> search
   <$action-setfield $tiddler="$:/temp/mysearch" 
text={{$:/temp/mysearch/input}} />
</$button>
<$button> reset
   <$action-setfield $tiddler="$:/temp/mysearch/input" text="" />
   <$action-setfield $tiddler="$:/temp/mysearch" text="" />
</$button>
<$reveal state="$:/temp/mysearch" type="nomatch" text="">
   <$list filter="[prefix{$:/temp/mysearch}]"><li><$link/></li></$list>
</$reveal>

notes:
* the $edit-text saves its input to $:/temp/mysearch/input
* the search $button copies that input to $:/temp/mysearch
* the reset $button clears both temp tiddlers
* the $reveal is used to prevent the search from finding ALL tiddlers when 
the input is blank
* the $list does the search, using the value copied into $:/temp/mysearch

let me know how it goes...

enjoy,
-e


-- 
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/7bcfaddf-8be0-477c-9bc4-0d66692f37ado%40googlegroups.com.

Reply via email to