adonis1976
asked on
Read a string value
Hi experts:
I have a form field for zipcode in US. My problem is that sometimes people tend to put in the post box number after the zip code, like 12345-4444. I'm using the first 5 digits to compare it with a zip code database i have here and then send the user to a particular page. How can I just read the first 5 digits of the zip code field and then compare it with a table in the DB and construct a query? I'm not sure if I'm clear enough.
I have a form field for zipcode in US. My problem is that sometimes people tend to put in the post box number after the zip code, like 12345-4444. I'm using the first 5 digits to compare it with a zip code database i have here and then send the user to a particular page. How can I just read the first 5 digits of the zip code field and then compare it with a table in the DB and construct a query? I'm not sure if I'm clear enough.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jyokum hit it right on the head, just to give some flavor though, assuming your visitors always use the - you can do listfirst(form.zipcode,'-' ). jyokum's is more reliable though.
ASKER
jyokum:
I just increased points this question to 500 points just to say thanks to your great help. It just worked like a champ. I thought you deserved more than 250 points for answering this question so quickly. Thanks again.
I just increased points this question to 500 points just to say thanks to your great help. It just worked like a champ. I thought you deserved more than 250 points for answering this question so quickly. Thanks again.
thanks