Title: PHP in Contact Form 7 Syntax
Last modified: August 31, 2016

---

# PHP in Contact Form 7 Syntax

 *  [adminda](https://wordpress.org/support/users/adminda/)
 * (@adminda)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-in-contact-form-7-syntax/)
 * I am trying to include some PHP code in contact Form 7 but my syntax is not meeting
   the task (it sux). I was wondering if someone could help me out her. Here is 
   the codes intention:
    ~~~~~~~~~~~~~~~~~~~~~~~ [checkbox* alphabetchoice id:selectalpha
   exclusive “A” “B” “C”]
 * <if (selectalpha.value==’A’) {do action 1} else {don’t care}/>
    <if (selectalpha.
   value==’B’) {do action 2} else {don’t care}/> <if (selectalpha.value==’C’) {do
   action 3} else {don’t care}/>
 * Or nested
 * <if (selectalpha.value==’A’) {do action 1} else {<if (selectalpha.value==’B’){
   do action 2} else {do action 3}}/>
    ~~~~~~~~~~~~~~~~~~~~~~~ Any help would be
   greatly appreciated.
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [adminda](https://wordpress.org/support/users/adminda/)
 * (@adminda)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-in-contact-form-7-syntax/#post-7091538)
 * So far this is the code that I have put together but it is not working:
 * [checkbox districtcheck id:checkdistrict exclusive “Northeast District” “Northwest
   District” “Central District”]
 * <if (document.getElementById(‘checkdistrict’).value==’Northeast District’) { 
   document.getElementById(‘divned’).style.visibility=’visible’ } else { document.
   getElementById(‘divned’).style.visibility=’hidden’ }/>
 * Thanks for any help out there!

Viewing 1 replies (of 1 total)

The topic ‘PHP in Contact Form 7 Syntax’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [logic](https://wordpress.org/support/topic-tag/logic/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 1 participant
 * Last reply from: [adminda](https://wordpress.org/support/users/adminda/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/php-in-contact-form-7-syntax/#post-7091538)
 * Status: not resolved