Support » Plugin: Contact Form 7 » filter wpcf7_validate_text doesn't seem to work with qtranslate?

  • Hello,

    So i added a custom filter wpcf7_validate_text validation but it doesn’t seem to work with qtranslate and a form in another language.

    function cf7_custom_form_validation($result,$tag) {
        $type = $tag['type'];
        $name = $tag['name'];
        $code= $_POST['gotcode'];
        $invcode= $_POST['invcode'];
        $gatewaycode= $_POST['gateway_code'];
      if(($name == 'gotcode') && ($hebcode=='1')){
          if($invcode == ''){
            $result['valid'] = false;
            $result['reason']['gotcode'] = 'No code';
          }
          if($invcode == 'No valid code'){
             $result['valid'] = false;
            $result['reason']['gotcode'] = 'No valid code';
          }
      }
      if(($name == 'gotcode') && ($hebcode=='0')){
          if($gatewaycode=='free'){
            $result['valid'] = false;
            $result['reason']['gotcode'] = 'Select Payment method';
          }
      }
     return $result;
    }
    add_filter('wpcf7_validate_radio','cf7_custom_form_validation', 10, 2);

    How can i fix this?

    btw: i have one select menu as html code not with WPCF7 shortcode, should i add a class?

    https://wordpress.org/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘filter wpcf7_validate_text doesn't seem to work with qtranslate?’ is closed to new replies.