Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Implement your own custom validation.

    Thread Starter roland777

    (@roland777)

    Thanks for the hint. I implemented a validation on some fields (in my test system), but i want to implement a validation that does not apply to a single field, but to the entire form.
    In this case the invalidate message does not belong to a single field, but to the entire form. For this I am looking for a solution.

    Hi Takayuki.
    Personaly I’ve tried to implement my own custom validation on text-fields but it seems like it is never called.
    On this sample I’ve tested I’ve coded an extreme mode that reject every text field with an error, but nothing occured… The form is validated… :

        function wpcf7_voucher_code_validation_filter($result,$tag) {
             $tags = new WPCF7_Shortcode( $tags );
             $result->invalidate( $tags, __( 'NOT VALID', 'mytest' ));
    
            return $result;
        }
    
        add_filter('wpcf7_validate_text', 'wpcf7_voucher_code_validation_filter', 20, 2);
        add_filter('wpcf7_validate_text*', 'wpcf7_voucher_code_validation_filter', 20, 2);
    

    How is it possible ?

    • This reply was modified 7 years, 6 months ago by wptechnology.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Validate form before sending’ is closed to new replies.