I need a customized thank you page which will be showed after submitting contact form (contactform7), the form will show the name and email address entered by user.

below is the example thank you page:

Thank you xxx : someone from our office will get in touch with you via xxx@example.com within 24 hours.

有帮助吗?

解决方案

I figured out a solution by utilizing the Additional Settings of contact form 7 and placed following code in these settings.


Note:it only works for Ajax based form.

on_sent_ok: "var name = $('.wpcf7 input[name=your-name]').val();var email = $('.wpcf7 input[name=your-email]').val();$('.wpcf7').hide();$('.entry-title').html('Thank you');$('.entry-content').html('thank you '+name+' : someone from our office will get in touch with you via '+email+' within 24 hours.');" 



Open up your contact form configuration page and paste above code as shown below:

Additional Settings window

Sample Output:

Sample Output

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top