Page 1 of 1

Please - How to test when a field is null ? ? ?

Posted: Fri Feb 04, 2022 9:33 pm
by honza1965
I would like to use the PHP function is_null. But. I'm entering '#field_name#' or #field_name#
for example in PHP AfterSave:

Code: Select all

if (is_null ('#field_name#')) {
   echo "Field is null";
}
but it doesn't work . . . .

Thank you very much for the idea of NULL testing :ponder:

Re: Please - How to test when a field is null ? ? ?

Posted: Sat Feb 05, 2022 9:27 am
by kev1n
Object values are usually not null but blank when retrieved as a Hash Cookie. (even if they are null in the db)

Code: Select all

if ('#field_name#' == '') {
 
}
If you really want to check for null values, you need to retrieve the values from the db directly.

Re: Please - How to test when a field is null ? ? ?

Posted: Sat Feb 05, 2022 7:47 pm
by honza1965
:hi: Great! ! ! Thank you so much - everything is OK