Copy link to clipboard
Copied
Banging my head against this one. I have two cfselect menus using bind. The first one populates the second. It's working fine except for this one wrinkle: the second select menu gets populated with zip codes. If they have leading zeroes (e.g. 02842) the zero gets clipped. The datatype in MySQL is char(5).
If I just throw a regular query on the data and dump it it comes back with the zeroes fine.
Bug? Workaround?
CF8 BTW.
Thanks.
Copy link to clipboard
Copied
Workaround - instead of binding, invoke the method and use the returned query.
Copy link to clipboard
Copied
But if I just invoke the method (which I know returns results with the zero respecting the char datatype) doesn't that kill the interactivity between the bound menus? Right now when you select a state from the first menu a list of available delivery areas determined by zip code is returned. So I want to preserve that ability. I don't want to just list every zip in the database. So am I missing some trick with invoke vs bind?
Copy link to clipboard
Copied
Here is an example of related selects without using binds. http://www.pathcom.com/~bracuk/code/RelatedSelects.htm
It may or may not be appropriate for your situation. I remember something on these forums a few years back about performance problems if you used this approach with too much data.
Copy link to clipboard
Copied
Thanks. I'll give them both a try.
Copy link to clipboard
Copied
And then there's the simple workaround. Use NumberFormat to force your zip codes to have 5 characters.
Copy link to clipboard
Copied
Check if this workaround helps you..
http://www.mail-archive.com/cf-talk@houseoffusion.com/msg337029.html
Copy link to clipboard
Copied
Thanks for the link. What a clunker but if it works it works. I'll post either way.
Copy link to clipboard
Copied
The "stupid hack" did it.
Thanks for your help.