Code:
function zipcode_detect(){
var albay_zipcode = Array("4509","4502","4501","4503","4515","4500","4507","4504","4510","4512","4514","4504","4516","4506","4517","4508","4511","4513");
var albay_town = Array("bacacay","camalig","daraga","guinobatan","jovellar","legazpi city","libon","ligao","malilipot","malinao","manito","oas","pio duran","polangui","rapu-rapu","sto. domingo","tabaco","tiwi");
var ddf = document.form_zip.addrz.value;
for(var count = 0; count<18; count++ ){
var input = ddf.match(albay_town[count]);
if(input){
alert('match '+albay_zipcode[count]);
}else{
alert('not');
}
}
}//end of function
example input: camalig, albay;
the output must be: match 4502;
can you help me please. . . :)
Comment