Title: Auto populate form fields
Last modified: August 21, 2016

---

# Auto populate form fields

 *  [whatachamp](https://wordpress.org/support/users/whatachamp/)
 * (@whatachamp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/auto-populate-form-fields/)
 * Hello,
    I use this plugin frequently and have the pro version but thought I’d
   put this out to the WordPress community to see if any one can help.
 * I have a page listing people’s profiles. Each profile is a custom post type. 
   Each profile listing has a link to the contact page – I want to auto populate
   a field on the contact form with that profile name.
 * So far I have added to functions.php
 *     ```
       add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
       function my_custom_default_value($new_value, $field){
         if($field->id == 167){ //change 25 to the ID of the field
           $new_value = 'default'; //stores the value of the referring URL
         }
         return $new_value;
       }
       ```
   
 * This successfully brings through the word default into the form field. I’m wondering
   how I could put in the profile name? The profile name is actually the_title for
   the custom post type.
 * Any pointers would be greatly appreciated. Thanks.
 * [http://wordpress.org/plugins/formidable/](http://wordpress.org/plugins/formidable/)

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

 * ![](https://ps.w.org/formidable/assets/icon-256x256.png?rev=2588749)
 * [Formidable Forms - Contact Form Plugin, Survey, Quiz, Payment, Calculator Form & Custom Form Builder](https://wordpress.org/plugins/formidable/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/formidable/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/formidable/)
 * [Active Topics](https://wordpress.org/support/plugin/formidable/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/formidable/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/formidable/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [whatachamp](https://wordpress.org/support/users/whatachamp/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/auto-populate-form-fields/)
 * Status: not resolved