Forums

how to test for non blank field

dariegler 10 Mar, 2015
How can i test for non blank field and set a varable to 2. I tried the following din custom code in on submit and get no results
<?php
If $form->data['FNAMEG'] == " "
then $form->data['NUMBER'] =2
else 
$form->data['NUMBER'] = 1;
?>
GreyHead 10 Mar, 2015
Hi dariegler,

Please check the PHP Manual here for the correct syntax. And note that your code is checking for a single space, not for an empty string.

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