by philipt18 » January 11th, 2012, 1:40 pm
So I figured out a way to do this, but I also found a bug. It turns out that while !NULL is recognized as a value, leaving nothing there and just starting with a pipe works to create a value that is not accepted. Thus, I was able to do:
|--Select a Country--|default
US|United States
CA|Canada
...etc...
That worked. Then I tried to do something similar for states and provinces. As I don't have a way to require the state/province only if the user has selected US or Canada, I have to leave the state/province field as optional. I created a piped list of US States and Canadian provinces (reproduced in full below). Even though I added the default tag to the first line which told people to select an option (similar to the Country menu above which worked fine), it never selected that as the default. Instead, the system always selected the non-selectable line I inserted above the provinces:
|--Canada--
Why was this line selected? I have no idea. No matter what I tried, it always selected that line. As a temporary fix I removed the lines indicating United States and Canada, and just merged the two lists into a single list. Seems to be a bug. The full piped list was:
|--Please Select--|default
|--United States--
AL|Alabama
AK|Alaska
AZ|Arizona
AR|Arkansas
CA|California
CO|Colorado
CT|Connecticut
DE|Delaware
DC|District Of Columbia
FL|Florida
GA|Georgia
HI|Hawaii
ID|Idaho
IL|Illinois
IN|Indiana
IA|Iowa
KS|Kansas
KY|Kentucky
LA|Louisiana
ME|Maine
MD|Maryland
MA|Massachusetts
MI|Michigan
MN|Minnesota
MS|Mississippi
MO|Missouri
MT|Montana
NE|Nebraska
NV|Nevada
NH|New Hampshire
NJ|New Jersey
NM|New Mexico
NY|New York
NC|North Carolina
ND|North Dakota
OH|Ohio
OK|Oklahoma
OR|Oregon
PA|Pennsylvania
RI|Rhode Island
SC|South Carolina
SD|South Dakota
TN|Tennessee
TX|Texas
UT|Utah
VT|Vermont
VA|Virginia
WA|Washington
WV|West Virginia
WI|Wisconsin
WY|Wyoming
|--Canada--
AB|Alberta
BC|British Columbia
MB|Manitoba
NB|New Brunswick
NL|Newfoundland and Labrador
NS|Nova Scotia
NT|Northwest Territories
NU|Nunavut
ON|Ontario
PE|Prince Edward Island
QC|Quebec
SK|Saskatchewan
YT|Yukon