0

I have a Repeater field which creates "jobs" each job has title, text as sub-fields and also a contact form 7 form which sends jobs applications.

I want to add hidden field which will also send the sub-field "title" so whenever form is submitted we know which job the sender sent the application from

Tried to use:
Contact Form 7 Dynamic Text Extension

but it is not working with ACF as far as I'm concern any help will be appreciated

gil hamer
  • 559
  • 4
  • 9
  • 27
  • 1
    Sorry, but your question is unclear. It would be more helpful to at least see the structure of your ACF code, and how your form is submitted. But in short... you would want to make a custom form tag to do what you want. – Howard E Nov 21 '20 at 11:16

1 Answers1

0

you could use CF7's 'wpcf7_form_hidden_fields' filter before your form is displayed,

add_filter('wpcf7_form_hidden_fields', 'add_job_title');
function add_job_title($hidden){
 //$current_job is the currenlty job loaded.
 $hidden['job_title']= $current_job->sub_title;
 return $hidden;
}

when the form is submitted, $_POST['job_title'] will have the value of the hidden field.

Aurovrata
  • 2,000
  • 27
  • 45