Greetings smart people,
I'm trying to generate a form where one of the input areas ends up in a
tooltip (the notes and sources area). I've got a working model, but I don't
like the way it's implemented. It seems like there should be a more elegant
way to do it, but I haven't found a working solution after a few hours of
fiddling. The screenshot shows the form with my ugly way where I use the
default text parameter to include the spans for the tooltip and the actual
input is between them. What I want is to have a macro that adds these spans
and I don't have to have them visible. The code I'm currently using to
generate this is below the screenshot. I've defined a macro that I think
will work at the top, but I haven't been able figure out a way to invoke it
and have it work. Any help would be greatly appreciated.
[image: Screenshot 2021-03-24 142940.png]
\define newtitle(name,date)
$name$ ($date$)
\end
\define newtext(text)
<span class="trtooltip">Hover...
<span class="trtooltiptext">
$text$
</span>
</span>
\end
\define NewMileageEntry()
<$vars
temp="$:/temp/NewEntry">
Company Performing Activity: <$select tiddler=<<temp>> field=company
tooltip="Select Company">
<$list filter='[!is[system]tag[Railroads]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<p/>
Mileage Received From: <$select tiddler=<<temp>> field=from
tooltip="Select railroad that mileage was received from">
<$list filter='[!is[system]tag[Railroads]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<p/>
Mileage Transferred To: <$select tiddler=<<temp>> field=to
tooltip="Select railroad receiving the mileage">
<$list filter='[!is[system]tag[Railroads]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<p/>
Date: <$edit-text
tiddler=<<temp>>
field=date
class=fieldinput
tag=input
size=12
placeholder="yyyy-mm-dd"
/>
<p/>
Mileage: <$edit-text
tiddler=<<temp>>
field=mileage
class=fieldinput
tag=input
size=8
/> 
Not in Kansas? <$checkbox tiddler=<<temp>> field="outofstate"
checked="yes" unchecked="" default=""></$checkbox>
<p/>
(C)onstructed, (A)bandoned, (S)old, (L)eased, (R)eclassified:
<$edit-text
tiddler=<<temp>>
field=mileagetype
class=fieldinput
tag=input
size=4
/>
<p/>
Origin: <$edit-text
tiddler=<<temp>>
field=origin
class=fieldinput
tag=input
size=72
/>
<p/>
Destination: <$edit-text
tiddler=<<temp>>
field=destination
class=fieldinput
tag=input
size=72
/>
<p/>
Notes, Sources, etc.:
<$edit-text
tiddler=<<temp>>
field=notes
class=fieldarea
tag=textarea
default="""<span class="trtooltip">Hover...
<span class="trtooltiptext">
Enter your text here.
</span>
</span>"""
/>
<p/>
<$button tooltip="save input" > {{$:/images/train-track}} Add New
Mileage
<$vars
date={{{ [title<temp>get[date]] }}}
mileage={{{ [title<temp>get[mileage]] }}}
mileagetype={{{ [title<temp>get[mileagetype]] }}}
outofstate={{{ [title<temp>get[outofstate]] }}}
origin={{{ [title<temp>get[origin]] }}}
destination={{{ [title<temp>get[destination]] }}}
notes={{{ [title<temp>get[notes]] }}}
company={{{ [title<temp>get[company]] }}}
source={{{ [title<temp>get[source]] }}}
from={{{ [title<temp>get[from]] }}}
to={{{ [title<temp>get[to]] }}} >
<$wikify name=tidname text="""<$macrocall $name=newtitle
name=<<company>> date=<<date>> />""">
<$set name="namelink" filter="[title<company>]">
<$set name="fromlink" filter="[title<from>]">
<$set name="tolink" filter="[title<to>]">
<$action-createtiddler
$basetitle=<<tidname>>
date=<<date>>
mileage=<<mileage>>
mileagetype=<<mileagetype>>
origin=<<origin>>
outofstate=<<outofstate>>
destination=<<destination>>
tags=<<namelink>>
company=<<namelink>>
from=<<fromlink>>
to=<<tolink>>
text=<<notes>> />
</$set>
</$set>
</$set>
</$wikify>
</$vars>
<$action-deletetiddler $filter="[<temp>]" />
</$button>
<$button tooltip="cancel input"> {{$:/core/images/cancel-button}} Clear
Entries
<$action-deletetiddler $filter="[<temp>]" />
</$button>
</$vars>
\end
--
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/0afe2c3b-3102-4d23-997c-6831de089924n%40googlegroups.com.