Contact Form 7 Check for Empty fields with PHP

General Tech Bugs & Fixes 2 years ago

1 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 30 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I've got a contact form 7 form that I'm looking to execute php in the Message Body. Here i try to check is empty [company_name2] or [zip-code-emp2] or [street_emp2] or [city_field_emp2] . If one of them is not empty, them i must show paragraph with this information, if they are empty, they must do not sent in Message Body. Can i check this in Message Body or i must create function in function.php and how to send email from this function?

profilepic.png
manpreet 2 years ago

There is a checkbox in cf7 (on the mail panel) under the textarea where you define your mail. I think it's called 'Exclude lines with blank mail tags'.

I think that should work for you.


1 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community