Title: Can&#8217;t validate consent_checkboxes fields
Last modified: April 28, 2018

---

# Can’t validate consent_checkboxes fields

 *  Resolved [wwwilson](https://wordpress.org/support/users/wwwilson/)
 * (@wwwilson)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/cant-validate-consent_checkboxes-fields/)
 * Hello,
 * I have used…
 * `GDPR::consent_checkboxes();`
 * …in my registration form which produced a list of form fields, however, I am 
   struggling with validating them. On the front-end, validation works, but if I
   delete the checkbox in inspect I can still proceed with registration without 
   selecting required fields. In my backend validation hook (using PMPRO plugin),
   I have tried
 *     ```
       if (!isset( $_REQUEST['privacy-policy'] )) {
       //do validation
       return false;
       }
       ```
   
 * … which normally fires for other fields but is not picking up GDPR fields. I 
   have tried changing the $_REQUEST to ‘user_consents[privacy-policy]’ and ‘privacy-
   policy-consent’ too but having no luck.
 * Any ideas how I can fire validation for the consent_checkbox fields? Any help
   would be greatly appreciated!
 * Cheers,
 * Andrew

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [wwwilson](https://wordpress.org/support/users/wwwilson/)
 * (@wwwilson)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/cant-validate-consent_checkboxes-fields/#post-10227932)
 * On that note: It would also be great to know how I could pull a list of required
   fields at the backend too (so validation doesn’t have to be done manually each
   time).
 *  Plugin Author [Fernando Claussen](https://wordpress.org/support/users/fclaussen/)
 * (@fclaussen)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/cant-validate-consent_checkboxes-fields/#post-10236901)
 * Hi [@wwwilson](https://wordpress.org/support/users/wwwilson/),
 * Sorry, it took me this long to reply. I didn’t notice your post until now.
 * You should try `$_POST['user_consents']`. This will return an array. Each key
   is the consent ID.
 * Regarding a way to get consents in the backend, you can do this: `$consent_types
   = get_option( 'gdpr_consent_types', array() );` and filter with `array_filter`
   to only get the ones that are required if you want.
 * I hope this helped.
 *  Plugin Author [Fernando Claussen](https://wordpress.org/support/users/fclaussen/)
 * (@fclaussen)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/cant-validate-consent_checkboxes-fields/#post-10236906)
 * Kudos for adding a backend validation.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Can’t validate consent_checkboxes fields’ is closed to new replies.

 * ![](https://ps.w.org/gdpr/assets/icon.svg?rev=1837142)
 * [GDPR](https://wordpress.org/plugins/gdpr/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gdpr/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gdpr/)
 * [Active Topics](https://wordpress.org/support/plugin/gdpr/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gdpr/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gdpr/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Fernando Claussen](https://wordpress.org/support/users/fclaussen/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/cant-validate-consent_checkboxes-fields/#post-10236906)
 * Status: resolved