Strategy for storing and displaying form dropdown data for provinces, states, prefixes?
Posted
by meder
on Stack Overflow
See other posts from Stack Overflow
or by meder
Published on 2010-01-06T03:12:03Z
Indexed on
2010/05/15
1:44 UTC
Read the original article
Hit count: 342
I'm currently migrating from a class that stores lists of countries, states & provinces in the form of arrays to using Zend's Locale data in the form of ldml xml files. These ldml files provide localised lists of countries, currencies, languages - so I'm not exactly sure where I should store US States, ( Canadian Provinces ), Prefixes - I was thinking possibly just create a generic xml file and store it in the same directory as the ldml files, but having doubts because it wouldn't really be localised as I'd store it in English.
Should I go with storing it in a generic xml file, or possibly update each of the locale files ( eg en.xml ) and append them? The latter is probably not worth the work, which is why I'm swaying towards just a general.xml
or dropdown-data.xml
.
As for generating dropdown options, I suppose I could just say, grab all US states, append the array with Canadian provinces, and append that with an 'Other' option - does this seem like the right way to go about?
© Stack Overflow or respective owner