Hi, I have a question about using javascript in checkboxes
(CheckboxPlugin)
I have this:
[_{}{var wowser=store.getValue("fake
test","value");store.setValue("BMI","value",wowser) }] set value in
bmi with checkbox
[_{}{store.setValue("Basal Metabolic Index","value",0)}] set same one
back to zero
<<wikify [[%0]] "value@BMI">>
The first checkbox sets the field called "value" in the tiddler
[[BMI]] to the same value as the field "value" in the tiddler [[fake
test]]. This happens whether the box is checked or unchecked
The second checkbox sets that remote field to 0, whether you're
checking it or unchecking it...
Is there a way to have one javascript execute with "check" and a
different one with "uncheck" on the one checkbox?
I read that there are 3 different code blocks in the checkbox macro:
[x{javascript}{javascript}{javascript}] , didn't totally understand it
and so tried the "reset to zero" code in the last {}, but that just
superceded the first code, and so the value was permanently "0"
Can this be done with the CheckboxPlugin as is, or should I try
something else, like just doing some javascript with an on-click/
button (one for "on" and another for "off")?
Thanks,
Dave
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.