Checkboxes and simple captcha bug
-
Hello, required checkbox not checking and simple captcha always show error.
-
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 to get it to work?
without “CF7 Smart Grid Design Extension” all work
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!
$this->loader->add_filter( ‘wpcf7_validate’, $plugin_public, ‘filter_wpcf7_validate’, 30, 2 );
problem in function “filter_wpcf7_validate”
for “Simple captcha”:
you delete hidden field
$data = $this->remove_hidden_fields_from_conditional_plugin($data);
where send captcha valueexample:
<input name=”_wpcf7_captcha_challenge_your-captcha” value=”126144047″ type=”hidden”>
“_wpcf7_captcha_challenge_your-captcha” remove
and result always error
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.”
can you add filter to disable “private function define_public_hooks() {“
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 valueno, 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.
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.phpfunction 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;
}sorry for my english is not good)
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 );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?
checkboxes work fine,
not recaptcha, Really Simple CAPTCHA (https://contactform7.com/captcha/)
i described the problem above
[recaptcha]
is now the recommended 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 6 years, 7 months ago by Aurovrata Venet.
thank you
- The topic ‘Checkboxes and simple captcha bug’ is closed to new replies.