Title: Checkboxes and simple captcha bug
Last modified: April 30, 2018

---

# Checkboxes and simple captcha bug

 *  Resolved [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/)
 * Hello, required checkbox not checking and simple captcha always show error.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/page/2/?output_format=md)

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10231732)
 * > required checkbox not checking
 * this is a cf7 issue, please enquire on the cf7 support forum.
 * > simple captcha always show error
 * did you check with cf7 forums? Have you following the cf7 [documentation](https://contactform7.com/captcha/)
   to get it to work?
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10231749)
 * without “CF7 Smart Grid Design Extension” all work
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10231859)
 * > without “CF7 Smart Grid Design Extension” all work
 * how do you expect me to help you if you don’t bother to post more details!
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10232011)
 * $this->loader->add_filter( ‘wpcf7_validate’, $plugin_public, ‘filter_wpcf7_validate’,
   30, 2 );
 * problem in function “filter_wpcf7_validate”
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10232016)
 * for “Simple captcha”:
 * you delete hidden field
    $data = $this->remove_hidden_fields_from_conditional_plugin(
   $data); where send captcha value
 * example:
    <input name=”_wpcf7_captcha_challenge_your-captcha” value=”126144047″
   type=”hidden”> ⌊captcha⌉
 * “_wpcf7_captcha_challenge_your-captcha” remove
 * and result always error
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10232075)
 * for “Checkbox”:
    “public function filter_wpcf7_validate($result, $tags){”
 * when the checkbox is not set, it is not send in $_POST
 * “if(!isset($_POST[$tag[‘name’]])) continue;//not submitted==disabled.”
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10232142)
 * can you add filter to disable “private function define_public_hooks() {“
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10232920)
 * > problem in function “filter_wpcf7_validate”
 * please don’t quote random lines of code, either provide constructive reviews 
   or none at all.
 * > you delete hidden field
   >  $data = $this->remove_hidden_fields_from_conditional_plugin(
   > $data); where send captcha value
 * no, this has nothing to do with the simple captcha.
 * > when the checkbox is not set, it is not send in $_POST
   >  “if(!isset($_POST[$
   > tag[‘name’]])) continue;//not submitted==disabled.”
 * indeed, this could be an issue for checkbox fields. I will check on my server
   and get back to you.
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10233386)
 * ok)
 * the filter already comes with valid values and check captcha:
    file – /cf7-grid-
   layout/public/class-cf7-grid-layout-public.php string – 755, function ‘filter_wpcf7_validate’
 * when you re-check captcha it already does not exist
    file – /cf7-grid-layout/
   public/class-cf7-grid-layout-public.php string – 755, function ‘filter_wpcf7_validate’
   $result = apply_filters( “wpcf7_validate_{$type}”, $result, $tag );
 * because after checking the captcha is removed:
    file – /contact-form-7/modules/
   really-simple-captcha.php
 *  function wpcf7_captcha_validation_filter( $result, $tag ) {
    $type = $tag->type;
   $name = $tag->name;
 *  $captchac = ‘_wpcf7_captcha_challenge_’ . $name;
 *  $prefix = isset( $_POST[$captchac] ) ? (string) $_POST[$captchac] : ”;
    $response
   = isset( $_POST[$name] ) ? (string) $_POST[$name] : ”; $response = wpcf7_canonicalize(
   $response );
 *  if ( 0 == strlen( $prefix ) || ! wpcf7_check_captcha( $prefix, $response ) ){
   
   $result->invalidate( $tag, wpcf7_get_message( ‘captcha_not_match’ ) ); }
 *  if ( 0 != strlen( $prefix ) ) {
    wpcf7_remove_captcha( $prefix ); }
 *  return $result;
    }
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10233391)
 * sorry for my english is not good)
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10233496)
 * > when you re-check captcha it already does not exist
   >  file – /cf7-grid-layout/
   > public/class-cf7-grid-layout-public.php string – 783, function ‘filter_wpcf7_validate’
   > $result = apply_filters( “wpcf7_validate_{$type}”, $result, $tag );
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10237613)
 * so there was indeed a bug due to checkboxes not being submitted by default.
 * I just released v2.1.5 with a fix for these issue. I am not sure why the recaptcha
   was not working, but this is also working now.
 * Can you upgrade and let me know if it works for you now?
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10237797)
 * checkboxes work fine,
 * not recaptcha, Really Simple CAPTCHA ([https://contactform7.com/captcha/](https://contactform7.com/captcha/))
 * i described the problem above
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10239210)
 * `[recaptcha]` is now the [recommended](https://contactform7.com/recaptcha/) and
   simpler way to include a captcha in your form.
 * Simple captcha plugin is not supported by the Smart-grid at this stage.
 * Maybe in the future I may add support if there is sufficient request for this.
    -  This reply was modified 8 years, 1 month ago by [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/).
 *  Thread Starter [tartarbar](https://wordpress.org/support/users/tartarbar/)
 * (@tartarbar)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/#post-10240060)
 * thank you

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/page/2/?output_format=md)

The topic ‘Checkboxes and simple captcha bug’ is closed to new replies.

 * ![](https://ps.w.org/cf7-grid-layout/assets/icon-256x256.png?rev=1834229)
 * [Smart Grid-Layout Design for Contact Form 7](https://wordpress.org/plugins/cf7-grid-layout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-grid-layout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-grid-layout/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-grid-layout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-grid-layout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/checkboxes-and-simple-captcha-bug/page/2/#post-10240161)
 * Status: resolved