Viewing 2 replies - 1 through 2 (of 2 total)
  • Dear Ameya

    Yes it is possible. You need to use this filter: wpcf_fields_slug_(slug)_value_get.

    Example

    I have a field, named “Single Line Field” width slug single-line-field. Then a function:

    add_filter('wpcf_fields_slug_single-line-field_value_get', 'my_default_value');
    
    function my_default_value($value)
    {
        if ( empty($value) ) {
            return 'this is default value';
        }
        return $value;
    }

    you can add this code to functions.php of current theme.

    cheers.

    Marcin

    Thread Starter jameya17

    (@jameya17)

    Hi Marcin,

    Thanks for your solution. It Works perfectly for me.

    Thanks,
    Ameya

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set Default value for text field.’ is closed to new replies.