Skip to content
Advertisement

Change CF7 Form values dynamically

I’ve been attempting to change CF7 form fields dynamically without using Contact Form 7 Dynamic Text Extension. I’ve seen a ton of articles on how to get posted data, just not on how I can overwrite existing values. My goal is to dynamically change the file attachment and add other meta-data associated with each post. Can this be done? Thank you!

Here’s what I have so far:

JavaScript

Advertisement

Answer

You can use my code to do this. Some explanations for your code:

1) Since id $cf7->id property is no longer accessible. Use id() method instead $cf7->id().

2) No need use & for callback $cf7 and $submission. Use for this return.

JavaScript

That is all, we are changed some tags, and send email with modified tag 😉

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement