Title: Auto-populate Hidden fields
Last modified: August 20, 2016

---

# Auto-populate Hidden fields

 *  Resolved [farvgnugn](https://wordpress.org/support/users/farvgnugn/)
 * (@farvgnugn)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/auto-populate-hidden-fields/)
 * Matthew,
    Great plugin! I went ahead and bought pro yesterday.
 * I have an issue pre-populating hidden fields and would like some help. (i just
   tried to piggy back the previous topic about this but it got resolved before 
   I got a response so i’m posting again here):
 * I return the default value in the hook just like for the rest of the fields (
   via form_id & field_id), but my output is the following:
 * <input type=”hidden” name=”vfb-59″ id=”vfb-hidden-59″ value=”” class=”vfb-text“
   >
 * Thanks for your help!
 * [http://wordpress.org/extend/plugins/visual-form-builder/](http://wordpress.org/extend/plugins/visual-form-builder/)

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

 *  Thread Starter [farvgnugn](https://wordpress.org/support/users/farvgnugn/)
 * (@farvgnugn)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/auto-populate-hidden-fields/#post-3626761)
 * Hey Matt – I found the problem – the hidden field doesnt handle the default value
   at all. Here’s the modficiation – line 832 of form-output.php:
 * before:
 *  case ‘custom’ :
    $val = trim( stripslashes( $opts_vals[1] ) ); break;
 * after:
 *  case ‘custom’ :
    if ( !empty( $default ) ) { $val = $default; } else { $val 
   = trim( stripslashes( $opts_vals[1] ) ); } break;
 * Think you could add this to the next version?
 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/auto-populate-hidden-fields/#post-3626930)
 * Yeah, shouldn’t be a problem to add that.

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

The topic ‘Auto-populate Hidden fields’ is closed to new replies.

 * ![](https://ps.w.org/visual-form-builder/assets/icon-256x256.png?rev=1205840)
 * [Visual Form Builder](https://wordpress.org/plugins/visual-form-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visual-form-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visual-form-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/visual-form-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visual-form-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visual-form-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/auto-populate-hidden-fields/#post-3626930)
 * Status: resolved