[ic] How to sett toggle ?

Bill Carr interchange-users@interchange.redhat.com
Fri Dec 21 08:52:00 2001


On Fri, 2001-12-21 at 07:59, Kaare Rasmussen wrote:
> I want to make a var as a toggle (either people want to see prices with or 
> without vat).
> I want it on every page, so I put it in the template. This is a Foundation 
> based shop.
> This works for a simple page like index.html (perhaps it could be simpler, 
> but for a test it's OK): 
> 
> <form action="[process]" method="post">
> <input type=hidden name="mv_nextpage" value="[var MV_PAGE 1]">
> [set test]
> [if scratch vat_display][set vat_display][/set][else][set 
> vat_display]1[/set][/else][/if]
> mv_todo=return
> [/set]
> <INPUT TYPE=submit NAME=mv_click VALUE="test">
> </form> 
You could use a hash for vat_display. Something like:
[calc]
	$Scratch->{vat_display}->{[item-code]} =
$Scratch->{vat_display}->{[item-code]} ? 0 : 1;
[calc]

-- 
Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413-253-6700