Viewing 2 replies - 1 through 2 (of 2 total)
  • cpwebsite,

    I found the solution!

    file: contact-form-7-city-field-extension.php
    line: 163

    Problem is in validation.
    Correct is:

    function wpcf7_cityfieldtext_validation_filter( $result, $tag ) {
    
    	$wpcf7_contact_form = WPCF7_ContactForm::get_current();
    
    	$type = $tag['type'];
    	$name = $tag['name'];
    	$value = isset( $_POST[$name] )
    		? trim( wp_unslash( strtr( (string) $_POST[$name], "\n", " " ) ) )
    		: '';
    
    	if ( 'cityfieldtext*' == $type ) {
    		if ( '' == $value ) {
    			$result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) );
    		}
    	}
    
    	return $result;
    }

    Plugin Author Pasquale Bucci

    (@pasqualebucci)

    Tnx arvendeil,
    version 1.1 now works.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Required Field not working’ is closed to new replies.