Support

Account

Home Forums ACF PRO Using ACF fields in Javascript Reply To: Using ACF fields in Javascript

  • Variable names cannot contain -, use DateY or Date_Y etc.

    If your values need to be strings then you need to enclose them in quotes and you need to put php tags around them and echo them

    
    var DateY = '<?php echo get_sub_field('date-year'); ?>';