Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
Created October 27, 2014 23:25
Show Gist options
  • Save ronnieduke/8f3313d274e5d12147e8 to your computer and use it in GitHub Desktop.
Save ronnieduke/8f3313d274e5d12147e8 to your computer and use it in GitHub Desktop.
Mura Form Builder States List
Add this as the "custom object" source of your dropdown in form builder:
[m]$.siteConfig('themeAssetPath')[/m]/display_objects/states-list.cfm
<!--- Add this to your theme display objects folder --->
<cfset dataset = StructNew() />
<cfset dataset.datarecordorder = ArrayNew(1) />
<cfset dataset.datarecords = StructNew() />
<cfset countryList = "Alabama,
Alaska,
Arizona,
Arkansas,
California,
Colorado,
Connecticut,
Delaware,
Florida,
Georgia,
Hawaii,
Idaho,
Illinois,
Indiana,
Iowa,
Kansas,
Kentucky,
Louisiana,
Maine,
Maryland,
Massachusetts,
Michigan,
Minnesota,
Mississippi,
Missouri,
Montana,
Nebraska,
Nevada,
New Hampshire,
New Jersey,
New Mexico,
New York,
North Carolina,
North Dakota,
Ohio,
Oklahoma,
Oregon,
Pennsylvania,
Rhode Island,
South Carolina,
South Dakota,
Tennessee,
Texas,
Utah,
Vermont,
Virginia,
Washington,
West Virginia,
Wisconsin,
Wyoming " />
<cfloop list="#countryList#" index="x">
<cfset ArrayAppend(dataset.datarecordorder,x)>
<cfset item = StructNew() />
<cfset item.datarecordid = x />
<cfset item.label = x />
<cfset item.value = x />
<cfset item.isselected = 0 />
<cfset dataset.datarecords[x] = item />
</cfloop>
@deeztek
Copy link

deeztek commented May 11, 2016

This does not seem to work at all. When I integrate with my form, the form stops working completely and does not display anything. There is no error and no indication to find out what's wrong. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment