0

I am trying an IF statement to check if the user has actually selected a value in the ACF DatePicker but this doesn't validate correctly. Any ideas?

$fxdate = get_field('fl_date');
if (isset($fxdate)) {echo "set";} else {echo "not set";}
2

1 Answer 1

0

Please check if echoing $fxdate is working.

$fxdate = get_field('fl_date');

In ACF simply below code works,

if($fxdate){ echo "set"; } else { echo "not set"; }
1
  • this doesn't work for me
    – JoaMika
    Jun 30, 2018 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.