WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
filter wpcf7_validate_text doesn't seem to work with qtranslate? (2 posts)

  1. DDT
    Member
    Posted 12 months ago #

    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/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 12 months ago #

    Where is the $hebcode coming from?

Reply

You must log in to post.

About this Plugin

About this Topic