In this post, I document a feature that you can take advantage of when defining labels for selectors like radio buttons, dropdowns and checkboxes. Each of the selections you define can have a separate value and title, which is the printed value the user sees. The “value” is what is actually stored in the database.
In the simplest case, you would just define your choices as a comma-separated list:
But let’s say internally, these cities are represented by a code, which is what you want to store in the database. You don’t expect the user to know these codes, so they need to see the name. You would do that like this, using the double colon to create a title::value pair:
Great, but Washington is usually written “Washington, D.C.” and you’d like it to be presented that way. If you try that in the values list for the field, it won’t work right because the plugin will detect the comma and parse “D.C.” as a separate item.
The way around that lies in the fact that the title is just a displayed string on the web page…so in that context you can use an HTML entity, and it will display the comma without tripping up the parser.