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.
- The topic ‘Auto populate form fields’ is closed to new replies.