add_action('frm_after_create_entry', 'frm_add_entry_id_for_drafts', 42, 2);However, I am having troubling passing this field value within my view shortcode. Here is how I am showing the view right now within an html field: [display-frm-data id="81" entry="[290]" drafts="1" filter="limited"]; however, this doesn't seem to work. Any feedback is appreciated.
add_action('frm_after_update_entry', 'frm_add_entry_id_for_drafts', 42, 2); function frm_add_entry_id_for_drafts($entry_id, $form_id) {
if ($form_id == 2) { // Change to the ID of your form
$field_value = FrmEntryMeta::get_entry_meta_by_field($entry_id, 290);
if (empty($field_value)) {
// Act if field 290 is empty
FrmEntryMeta::add_entry_meta($entry_id, 290, "", $entry_id); // Change 290 to the ID of the field where you want to store the entry ID
}
}
}
I'll admit I still don't get it, however, to give a general answer:
1. To pass a param to a view shortcode, you can just add it to the shortcode. e.g., [display-frm-data id=18267] => [display-frm-data id=18267 myparam="myvalue"]
2. If you're in a form, with a field that contains a view shortcode you'll have to use jQuery to fill in the parameter value, because there's no way to set the value into that shortcode using an FF shortcode because of nested shortcodes. The solution is very simple jQuery, though that's easy for me to say.
Here's to hoping Victor says I'm wrong.
Please login or Register to submit your answer
I'm confused as to what you're trying to do. If you want to show a summary of the form prior to submission, you can add the Summary field to your form. frm_after_create_entry and frm_after_update_entry only work once the entry is saved, so I'm not even sure how you're using that in this scenario. The form entry doesn't have an id until it's saved.