Forums

Form name cannot be only numeric

enzo.orsi 15 Oct, 2015
Hi,
I discovered that Form Name cannot be only numeric.

If I am using a string Form Name in the debug I get:

Array
(
    [Contratto_di_locazione_di_box_auto] => 


But if I am using a numeric Form Name in the debut I get:

Array
(
    [0] => 
GreyHead 15 Oct, 2015
Hi enzo.orsi,

You are right. Form names (and element names and ids) are used in various places as variable names in PHP and JavaScript and as column names in MySQL. So they have to be valid in all of those languages.

You can use a-z, A-Z, 0-9 and underscore _ and the name must start with a letter, not a number, or an underscore.

Note: you can also use a dash - BUT that can cause some problems with MySQL unless the names are properly quoted as e.g. `my-form`. I recommend not using it.

Bob
This topic is locked and no more replies can be posted.