Since I began using CFML I’ve struggled with this problem every time I want to add a checkbox to a form that updates a database field.
The problem is that if the checkbox isn’t checked then no evidence of its existence is passed to the form’s action page. This causes a problem when updating a database field because you can’t rely on the FORM structure to provide a value of “no” or “off” that can be updated in your db field.
You therefore need to use something like this before your <cfupdate..>, <cfinsert…> or <cfquery…> tags.:
<cfparam name="FORM.mycheckbox" default="off">
Similarly when populating a form containing a checkbox you need to use a plain <input type=”checkbox”> HTML tag instead of the CFINPUT version. This then allows you to insert <cfif> tag like so…
<input type="checkbox" name="myCheckbox"
<cfif #dbQuery.myCheckbox# eq 'on'>
The db field must then be either a string-based data type or an enum type with ‘on’ and ‘off’ as its possible values.
Í’m trying out openBD as a platform to run an application that I already built in CFMX7 and there appear to be some incompatabilities. I’ll list them here as I encounter them:
XAMPP, by default, does not automatically restart when the server is rebooted. To make this happen do the following :
place symbolic links to the XAMPP startup and kill processes in the rc2.d folder:
ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp
Now XAMPP should restart when the server is rebooted.
Edit the following file:
and adjust it to your needs (in this example setup I will use the IP address 192.168.1.101)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
iface lo inet loopback
# This is a list of hotpluggable network interfaces
# They will be activated automatically by the hotplug subsystem.
# The primary network interface
iface eth0 inet static