Title: else if statement
Last modified: August 22, 2016

---

# else if statement

 *  Resolved [NextGenConcepts](https://wordpress.org/support/users/nextgenconcepts/)
 * (@nextgenconcepts)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/else-if-statement/)
 * Hello,
 * I am trying to get a form that does a redirect depending on the zip code entered.
   I have tried to use the example found at [https://wordpress.org/support/topic/plugin-contact-form-7-conditional-redirect-2?replies=4](https://wordpress.org/support/topic/plugin-contact-form-7-conditional-redirect-2?replies=4).
   If I only use one zipcode, it will work but when I start adding more, it stops
   working. I have added my code below. Any pointers would be greatly appreciated!
 * _on\_sent\_ok: ” if (document.getElementById(‘zipcode’).value==23223, 23231, 
   23219, 23250, 23232, 23075, 23222, 23030, 23227, 23234, 23225, 23224) {location.
   replace(‘[http://furniturehousecalls.com/?p=93&#8217](http://furniturehousecalls.com/?p=93&#8217);)}
   else if(document,getElementById(‘zipcode’).value||23114, 23112, 23113, 23838,
   23120, 23236, 23235{ location.replace(‘[http://furniturehousecalls.com/?p=95&#8217](http://furniturehousecalls.com/?p=95&#8217);)}
   else if(document,getElementById(‘zipcode’).value||23233, 23229, 23238, 23226,
   23294, 23221, 23230, 23228, 23220, 23111, 23116, 23005, 23060, 23059, 23058{ 
   location.replace(‘[http://furniturehousecalls.com/?p=96&#8217](http://furniturehousecalls.com/?p=96&#8217);)}
   else if(document,getElementById(‘zipcode’).value||23831, 23832, 23836, 23834,
   23801, 23803, 23805, 23860, 23875, 23237{ location.replace(‘[http://furniturehousecalls.com/?p=97&#8217](http://furniturehousecalls.com/?p=97&#8217);)
   else { location.replace(‘[http://www.furniturehousecalls.com/&#8217](http://www.furniturehousecalls.com/&#8217);)}“_
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

The topic ‘else if statement’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [NextGenConcepts](https://wordpress.org/support/users/nextgenconcepts/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/else-if-statement/)
 * Status: resolved