Customising Contact Form 7 in wordpress
-
01-07-2021 - |
题
I'm using contact form 7 in my word press. Here i have created 2 forms namely form 1, form 2. when form 1 data's are filled and submitted it need to go to form 2 page.
Here i don't want to send mail while submitting form 1. so i need to stop sending email to form1 and after submitting form 1 it needs to go to form 2 page. if i submit form 2 i need to send an email . I have assigned both forms to separate pages. How to do it?
any help is greatly appreciated!
Thanks in advance
解决方案
On the contact management page of Form 1 you will find the Additional Settings area near the bottom. Simply insert two lines into it:
demo_mode: on
on_sent_ok: "location = 'http://example.com/';"
With
demo_mode
setting you can stop e-mail sending. Additionally all the validations inlcuding Akismet will be done on the form fields.You can use the
on_sent_ok
JavaScript action hook to run one-line JavaScript code after succesful submitting. Withlocation
parameter you can specify the URL you want to redirect to.
Finally you may want to hide the pop up messages on Form 1 page. For this you can use e.g. some css
styling:
<form-id> .wpcf7-response-output {
display: none;
}
Tested on:
- Contact Form 7 Version 3.3.1
- WordPress Version 3.4.2