> Trying to evaluate and assign various stuff depending on a zip code coming
> from a cfform field.
>
>
> Basically:
>
> If the zipcode is 20101-23217 or 23290-24658 do thing ONE
> If the zipcode is 27060-28909 do thing TWO
> If the zipcode is 23218-23298 show error message ONE
> All other Zip Codes, show error message TWO
>
>
> Suggestions as to the best way to construct this?
>


I would suggest a CFIF....  I don't believe that CFCASE can handle ranges
only individual instances, but I could be wrong.....

<cfif (form.zipcode GTE 20101 AND form.zipcode LTE 23217) OR
(form.zipcode GTE 23290 AND form.zipcode LTE 24658>
<!--- Action ONE --->

<cfelseif form.zipcode GTE 27060 AND form.zipcode LTE 28909>
<!--- Action TWO --->

<cfelseif form.zipcode GTE 23218 AND form.zipcode LTE 23298>
<!--- Show Error ONE --->

<cfelse>
<!--- Show Error TWO --->

</cfif>

Hope that helps

Regards

Stephen (suitably coffee'd up)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to