Pages

Showing posts with label contact form 7. Show all posts
Showing posts with label contact form 7. Show all posts

Thursday, November 5, 2015

Contact form 7 remoce select box (Dropdown) default value

function my_wpcf7_form_elements($html) {
function replace_include_blank($name, $text, &$html) {
$matches = false;
preg_match('/
if ($matches) {
$select = str_replace('', '', $matches[0]);
$html = preg_replace('/
}
}
replace_include_blank('mc4wp-age', 'AGE*', $html);
return $html;
}
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements');

Thursday, May 1, 2014

Contact Form 7 Create Custom validation for all fields - [resolved]

If you want to add custom validation for contact form 7 input fields than please write below code:

add_filter('wpcf7_validate_FIELDNAME','cf7_custom_form_validation', 10, 2); // wpcf7_validate_email or wpcf7_validate_email*

function cf7_custom_form_validation($result,$tag) {
    /*
        Here you can write your custom code for validation
    */
}

Contact Form 7 customize response message - [resolved]

If you want to change response message by code for contact form 7 than please write below code:

add_action("wpcf7_ajax_json_echo", "cf7_change_response_message",10,2);

function cf7_change_response_message($items, $result){
    /*
        Here you can write your custom code for response message
    */
}