Custom validation function

You are using DaDaBIK version 8.1-Lerici enterprise, installed on 10-31-2017 (installation code: 0), the latest version of DaDaBIK is released on --
PHP Version: 5.6.3
mysql version: 5.6.36-82.1-log
Web server: Microsoft-IIS/8.5
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Hi,
I wrote a custom validation function but it works only if field type is Text. In my case I have a Date field type.
Any suggestion?
Thanks
 

eugenio

Administrator
Staff member
Hello Gianfranco,
the custom validation functions are supposed to only work on text and textarea field types.
I've just realized that this is not properly highlighted in the documentation, which seems to exclude only select_single and select_multiple, sorry for the inconvenience.

A quick hack to make those functions work even with date is the following: open /include/business_logic.php and change this line

if (($fields_labels_ar[$i]["type_field"] == "text" || $fields_labels_ar[$i]["type_field"] == "textarea")

with:

if (($fields_labels_ar[$i]["type_field"] == "text" || $fields_labels_ar[$i]["type_field"] == "textarea" || $fields_labels_ar[$i]["type_field"] == "date" )

please note that it hasn't been tested, though.

Best,
 
Top