change form values after submission
-
Hi Support,
We’ve been working on an api interface connected via contact form 7 and have it working bar a single issue as follows.
We create a hidden field on the form which we hope to populate with the response from the api (the status-code returned) within my wpcf7_validate_api call (validate_api). Once the api call has returned we update the $_POST[‘statuscode’] variable with the result. this value we presumed would be propagated to the [‘statuscode’] field variable within the cf7 mail page we have but somehow it is not.
Stepping through the code I notice that the $_POST variable changes are passed through to our wpcf7_before_send_mail function (mail_development) but the email sent has the statuscode set as an empty string (<input name=”statuscode” id=”statuscode” value=”” type=”hidden”>), the value on the form as it is submitted.
Any ideas on what we could be doing wrong here and any way to get this working i.e:-
form has a hidden field, form submits to an api and is validated, the api result is returned from the remote api and replaces the default empty string value for the statuscode field and the result is emailed to all parties.
Code is available on request but as mentioned initially all other aspects of this plugin are working as required. Thanks in advance
- The topic ‘change form values after submission’ is closed to new replies.