Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

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

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
honza1965
Posts: 20
Joined: Wed Apr 28, 2021 9:19 pm
Has thanked: 1 time
Been thanked: 1 time

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

Unread post 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:
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post 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.
honza1965
Posts: 20
Joined: Wed Apr 28, 2021 9:19 pm
Has thanked: 1 time
Been thanked: 1 time

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

Unread post by honza1965 »

:hi: Great! ! ! Thank you so much - everything is OK
Post Reply