%doc>
A tristate checkbox (with three values: true, false, and null).
Internally, this creates a checkbox, coupled via javascript to a hidden
field that actually contains the value. For now, the only values these
can have are 1, 0, and empty. Clicking the checkbox cycles between them.
%doc>
<%shared>
my $init = 0;
%shared>
% if ( !$init ) {
% $init = 1;
% } # end of $init
<%init>
my %opt = @_;
# might be useful but I'm not implementing it yet
#my $onchange = $opt{'onchange'}
# ? 'onChange="'. $opt{'onchange'}. '(this)"'
# : '';
$opt{'id'} ||= 'hidden_'.$opt{'field'};
my $curr_value = $opt{curr_value};
$curr_value = undef
unless $curr_value eq '0' or $curr_value eq '1';
%init>