CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Simple Validation for CheckBox

Print topic Send  topic

Author Message
Blair
Posted: 06/16/2003, 9:41 AM

Hi,

I need a validation for my check box which confirms the user has agreed to the terms and conditions. This is a simple yes = checked and no = unchecked. So if box not checked they get an error message ....with all the other error messages on the top of the form that says you must check yes I agree. I can't find any examples of this on the site. I realize its custom code. Do you know what code to use in PHP?

Sincerely

Blair
GreggB
Posted: 06/16/2003, 12:08 PM

For CCS:

In your form properties select “On Validation” Event and try the following code. Unfortunately I’m not in a position to test this code but something like this should work. I’m no PHP master but maybe this will get you started in the right direction.

Depending on how you’ve setup the Properties of your CheckBox makes the difference if you will use a zero 0 or “N”


If CCGetParam(“checkbox”, Empty) == 0 {
$yourformname->Errors->addError("You must Check Yes!");
}


GreggB

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.