Page 1 of 1

How do I check if a checkbox is selected, ?

Posted: Mon Dec 04, 2006 1:39 am
by Mythic Fr0st
I have a simple terms & conditions checkbox, I need to know how I can tell if its selected

E.G if (t&c == checked)
{
actions here
}

Posted: Mon Dec 04, 2006 1:43 am
by RobertGonzalez
Checkboes represent themselves as either empty or 'on'.

Posted: Mon Dec 04, 2006 2:00 am
by Mythic Fr0st
k, thanks


if (name == on)
i assume thats it

Posted: Mon Dec 04, 2006 2:45 am
by TheProgrammer
actually you should check if is set. something like this:

Code: Select all

if( isset(name) && name==true){...}

Posted: Mon Dec 04, 2006 2:52 am
by Mythic Fr0st
I have, that was just me typing a shorter version

real one has the isset() thing with it