# If else with states and zipcodes

**URL:** <https://forum.kirupa.com/t/if-else-with-states-and-zipcodes/189727>\
**Category:** Uncategorized\
**Created:** [June 5, 2006, 6:54pm UTC](https://forum.kirupa.com/t/if-else-with-states-and-zipcodes/189727 "2006-06-05T18:54:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![webdesign05](https://avatars.discourse-cdn.com/v4/letter/w/c89c15/32.png) [@webdesign05](https://forum.kirupa.com/u/webdesign05)\
**Post date:** [June 5, 2006, 6:54pm UTC](https://forum.kirupa.com/t/if-else-with-states-and-zipcodes/189727/1 "2006-06-05T18:54:19Z")

</div>

I’m having trouble with my script…

I’m making a form that directs you to the proper person in that area.

When I try inputing another state such as NY it keeps outputting “John Doe 2” instead of the proper name.

Here is my script. I don’t know if I can’t switch up zip and state…

Any help would be greatly appreciated !

on (release) {  
if (zip\>15000 && zip\<16899) {  
name = “John Doe”;  
}  
else if (zip\>16900 && zip\<19699) {  
name = “John Doe 2”;  
}  
else if (state = “NJ”) {  
name = “John Doe 3”;  
}  
else if (state = “NY”) {  
name = “John Doe 4”;  
}  
}
