Contact Form Processing Products - for all your needs

FormMail • Form Encryption • Hosted Forms

ZERO_IS_EMPTY Setting

This page documents the ZERO_IS_EMPTY configuration setting in FormMail.

Type Of Setting

ZERO_IS_EMPTY is an OPTIONAL setting, which means...

OPTIONAL : you can change this setting if you need to, but the default valueis fine for most circumstances.

Précis

Controls what "empty field" means.

Description

Set ZERO_IS_EMPTY to false if you don't want a field containing exactly "0" (without the quotes) to be treated as empty.

The default behaviour of PHP is to treat a field containing "0" as empty. Older versions of FormMail operated with this behaviour.

In many cases this is what you would want for a web form.

By setting ZERO_IS_EMPTY to false, a field must be completely empty to be treated as such.

By setting ZERO_IS_EMPTY to true, a field can be completely empty or contain "0", to be treated as empty.

This setting affects "required" testing, the "+" operator in "derived_fields", "conditions" testing, and template filling.

References:

If you're upgrading from version 6.01 or lower of FormMail through the Upgrade Wizard, the setting will be set to "true" to replicate previous behaviour. New FormMail downloads get the setting as "false".

Default Value

From version 9 onwards:

$ZERO_IS_EMPTY = false;

Before version 9:

define("ZERO_IS_EMPTY",false);

Examples

From version 9 onwards:

$ZERO_IS_EMPTY = true;

Before version 9:

define("ZERO_IS_EMPTY",true);
 
Close