ajaxCRUD.com

» a PHP class to create / read / update / delete from a database table using AJAX

   by loud canvas media

AjaxCRUD API Reference

<< Reference overview
<< Home

defineCheckbox

Sets the field to be of type 'checkbox'.
void defineCheckbox ( String fieldName, [ String value_on], [String value_off] )
Use this function if you have an on/off or yes/no type of field (two options). As such you want a simple checkbox to toggle between the options.

The default value for checked (on) is 1 and unchecked (off) is 0. However, you can set your own values, with the two optional parameters.

Details

Type function
Returns void
Default 1,0

Parameters

fieldName
The database field name
(optional) value_on
The value set when the checkbox is checked (default is 1)
(optional) value_off
The value set when the checkbox is unchecked (default is 0)

Example

$tblDemo->defineCheckbox("fldField2", "on", "off");

See also

New, Edit

 

"AjaxCRUD is wonderful."
~Peter Barone