checkbox

English! place to talk about development, programming and coding
Post Reply
tina
Znuny newbie
Posts: 48
Joined: 10 Apr 2012, 17:59
Znuny Version: 3.2.1
Real Name: boutayna

checkbox

Post by tina »

Hi,

I really need help, I try to develop a new web form that contain checkbox,

<input type="checkbox" name="SecuritySI" value="Yes" $Data{"Checked"}></input>

when a checkbox is checked it's ok,

but I need the value of the variable is "Yes" when it is checked and "No" when it is not

Can you help me plz
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: checkbox

Post by reneeb »

In your code you have to write something like this:

Code: Select all

my $CheckboxValue = $Self->{ParamObject}->ParamGet( Param => 'SecuritySI' );
if ( !$CheckboxValue || $CheckboxValue ne 'Yes' ) {
    $CheckboxValue = 'No'
}
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
tina
Znuny newbie
Posts: 48
Joined: 10 Apr 2012, 17:59
Znuny Version: 3.2.1
Real Name: boutayna

Re: checkbox

Post by tina »

thank you so mutch :)
tina
Znuny newbie
Posts: 48
Joined: 10 Apr 2012, 17:59
Znuny Version: 3.2.1
Real Name: boutayna

Re: checkbox

Post by tina »

thank you again,
and can you tell me how can I do it for display,
what I need is: if SecuritySI= 'yes' the checkbox appears checked
Post Reply