Javascript with "OR" statement - PDF Form
I have two form fields setup (one labeled "Zip" and the other labeled "Name") to where a user would type in their Zip code and the name field would populate with the sales person that covers that territory. Each sales person covers multiple territories so I want to list out each of their assigned zip codes using "or" syntax (||). However, the issue I'm running into is no matter what zip code I enter, it's only showing the last sales rep. Below is the code I'm entering inside the custom validation script for two sales reps and no matter what I enter, it populates Jane Doe.
This is relatively new to me and I'm sure I'm missing something. Thank you!
if (event.value=="64720"||"64730"||"64744"||"64759"||"64772"||"64801"||"64804"||"64831"||"64834"||"64836"||"64850"||"64870"||"65049"||"65065"||"65536"||"65583"||"65605"||"65613"||"65616"||"65622"||"65625"||"65672"||"65686"||"65706"||"65708"||"65714"||"65721"||"65737"||"65738"||"65781"||"65802"||"65804"||"65806"||"65807"||"65809"||"65810"||"71602"||"71603"||"71655"||"71701"||"71730"||"71742"||"71753"||"71801"||"71852"||"71854"||"71901"||"71909"||"71913"||"71923"||"71953"||"72012"||"72015"||"72019"||"72022"||"72023"||"72031"||"72032"||"72034"||"72076"||"72088"||"72104"||"72110"||"72112"||"72113"||"72114"||"72116"||"72120"||"72143"||"72150"||"72160"||"72201"||"72205"||"72207"||"72209"||"72211"||"72212"||"72223"||"72315"||"72364"||"72396"||"72401"||"72405"||"72450"||"72455"||"72501"||"72529"||"72543"||"72560"||"72601"||"72632"||"72653"||"72701"||"72703"||"72704"||"72712"||"72714"||"72715"||"72736"||"72740"||"72756"||"72758"||"72761"||"72762"||"72764"||"72801"||"72802"||"72830"||"72855"||"72901"||"72903"||"72908"||"72916"||"72921"||"72923"||"72927"||"72956"||"74003"||"74006"||"74010"||"74011"||"74012"||"74014"||"74015"||"74017"||"74019"||"74020"||"74021"||"74023"||"74037"||"74055"||"74063"||"74066"||"74070"||"74105"||"74114"||"74119"||"74133"||"74135"||"74136"||"74137"||"74145"||"74301"||"74344"||"74354"||"74361"||"74401"||"74403"||"74426"||"74429"||"74434"||"74437"||"74447"||"74464"||"74467"||"74501"||"74525"||"74601"||"74728"||"74745"||"74804"||"74820"||"74834"||"74848"||"74864"||"74868"||"74953"||"74955"||"75501"||"75503"||"75551"||"75570") this.getField("Name").value = "#01 - John Doe";
if (event.value=="46001"||"46012"||"46013"||"46016"||"46032"||"46033"||"46036"||"46037"||"46038"||"46040"||"46041"||"46052"||"46055"||"46060"||"46064"||"46072"||"46074"||"46077"||"46107"||"46112"||"46121"||"46122"||"46123"||"46131"||"46140"||"46142"||"46143"||"46151"||"46154"||"46158"||"46163"||"46168"||"46173"||"46176"||"46205"||"46214"||"46217"||"46219"||"46220"||"46227"||"46229"||"46236"||"46237"||"46239"||"46240"||"46250"||"46256"||"46259"||"46260"||"46268"||"46290"||"46310"||"46392"||"46507"||"46514"||"46516"||"46517"||"46526"||"46528"||"46530"||"46540"||"46544"||"46545"||"46550"||"46561"||"46565"||"46567"||"46580"||"46581"||"46582"||"46590"||"46601"||"46614"||"46615"||"46617"||"46628"||"46635"||"46703"||"46706"||"46714"||"46725"||"46733"||"46737"||"46738"||"46741"||"46750"||"46755"||"46761"||"46765"||"46767"||"46774"||"46777"||"46783"||"46802"||"46804"||"46805"||"46809"||"46814"||"46815"||"46818"||"46825"||"46835"||"46845"||"46901"||"46902"||"46923"||"46933"||"46947"||"46952"||"46953"||"46962"||"46970"||"46979"||"46992"||"47001"||"47006"||"47025"||"47042"||"47111"||"47112"||"47119"||"47122"||"47129"||"47130"||"47150"||"47167"||"47170"||"47172"||"47220"||"47240"||"47250"||"47265"||"47274"||"47304"||"47305"||"47327"||"47330"||"47331"||"47340"||"47346"||"47348"||"47359"||"47362"||"47371"||"47374"||"47394"||"47396"||"47421"||"47454"||"47901"||"47904"||"47905"||"47906"||"47909"||"47918"||"47944"||"47946"||"47960"||"47978"||"49002"||"49010"||"49015"||"49047"||"49068"||"49079"||"49085"||"49103"||"49112"||"49120") this.getField("Name").value = "#2 - Jane Doe";
