WordPress.org

Forums

Formidable Forms
Auto populate form fields (1 post)

  1. whatachamp
    Member
    Posted 2 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Formidable Forms
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.