Hornet | 5 Feb 23:43
Picon

[FormBuilder] Default Values.

Hello All,

Just want to start out by saying, this is a really great API and easy
to use. Which must be my problem. Below is the code I'm working with.
The problem I'm having is that I can't get the radio button or
checkbox to be either on or off. The $notact with either be 1 or 0,
yet nothing is checked. I thought I was doing what the documentation
was telling me. Can anyone see what I'm doing wrong?

sub edituser {
	&noauth if !&admin;
	&phead;
	my $stmt="select Users.Username, Users.Password, Users.BmsCustId,
Users.Email, Users.FullName, Users.NotActive, Groups.Group as fGroup
		from Users
	        left join Groups on Groups.pkey = Users.Group
		where Users.pkey=$input{edituser}";

	my $h=$dbh->selectrow_hashref($stmt);
	print dumper_html($h);
	my $notact=$h->{NotActive};
	delete $h->{NotActive};
	
	my $group=$dbh->selectall_arrayref("select Groups.Group from Groups");

	$form = CGI::FormBuilder->new(
			fields =>$h,
			smartness => 2,
	);
	$form->field(name=>'NotActive', value=> $notact, options=>"Deactivate
account");
#	print $q->checkbox(-name=>'NotActive', -checked=>$notact,
-label=>'Deactivate acccount'),
	print $form->render;
	
	&leave;
}

--

-- 

-Erik-
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane