So my script is simple right now just to test out the $entry field id's.

add_action("gform_after_submission_3", "set_post_content", 10, 2);
function set_post_content($entry, $form){
$subject = $entry["28"] . 'Applied as: ' . $entry["2"];
 mail( $emailremoved, $subject, $message);

Right now entry 28 is a dropdown, this one returns the selected value.

Entry 2 is the name field with split first and last. This returns nothing. Ive also tried $entry["2.1"] and get nothing.

Entry 34 (not added) is a multi checkbox. This value is not echoed out either.

This is a multipage form, but that shouldnt matter.

Any ideas why the values are not returning? They are saving to the form entry.


To debug you should print what's in $entry.

echo '<pre>' . print_r($entry,true) . '</pre>';
die();//You may need to kill the script to view..

Or email to yourself in your current mail function.

$message = '<pre>' . print_r($entry,true) . '</pre>';
  • Thanks a lot. I was so fixated on the single inputs that I didn't think to print them all. Thanks again for the help – David Hechler May 30 '12 at 15:03

As you are aware the normal and extended format name fields are constructed using multiple inputs, for this reason you also need to include the last digit from the input id in the key.

$entry['2.2'] // prefix
$entry['2.3'] // first
$entry['2.6'] // last
$entry['2.8'] // suffix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.