1

I've created a custom field (type read only) with ACF Field for users (Label: "Check Field Privacy"; name "privacy_field").

In my website I add a form where there is a checkbox to confirm the reading of the website policy. This is the checkbox

<p>
<input type="checkbox" name="foo_privacy_policy" id="foo_privacy_policy" class="checkbox" />
<label for="foo_privacy_policy"><?php _e( 'I accept terms and.......', 'foo' ) ?>
</label>

I need to assign "Yes" to Check Privacy Field if the checkbox is checked and "No" if checkbox isn't checked

I try with:

if ( isset($_POST['foo_privacy_policy']) ) {
    $privacy_field = "YES"; 
            }

It doesn't work...

fenixar
  • 11
  • 2
  • Check this article: https://stackoverflow.com/questions/47463330/custom-checkbox-in-product-settings-that-displays-a-custom-field-when-checked – Savan Dholu Jul 06 '21 at 10:05

1 Answers1

0

ACF it's not what you need. You can simply create a checkbox field and make it required

Ergest
  • 7