• Resolved handsofaten

    (@handsofaten)


    I need to insert a value programmatically into a form, which should not be visible to the user. I’ve tried using the vfb_field_default filter on a hidden field, but I think this filter is only intended for editable fields. Is there a way to either insert a field, or edit the value of a hidden field from another plugin?

    The only thing I can think of now is to set a default value on a text field, and then hide it using CSS. But I’d prefer to use an actual hidden field.

    http://wordpress.org/extend/plugins/visual-form-builder/

Viewing 1 replies (of 1 total)
  • Thread Starter handsofaten

    (@handsofaten)

    Now it appears the vfb_field_default filter is never called. After failing to get it working in my plugin, I tried putting this in the theme’s functions.php, and no default values are inserted:

    add_filter('vfb_field_default', 'reg_form_date_filter', 20, 4);
    function reg_form_date_filter( $default, $field_type, $field_id, $form_id ) {
        $default = 'xxx';
        return $default;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Programatically set field values’ is closed to new replies.