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.
It works!
Hi folks, as I tried out some possibilities, I found out about this one: If you wish to just give out some text in the pdb_result and pdb_list, just use the field radio button WITHOUT giving it any values, but type in your text/message as help text! Result: Plain help text without radio button, textfield or any other bullying stuff!!!
Wow.
Thanks for the tip! I didn’t know this would work.
Hi, thanxs for this great plugin and for your quick reaction here! I am thinking about using colors to choose from, perhaps in combination with text. Would this be possible in any way as a radio button? Its supposed to be like a category color scheme. Thanks in advance!
Yes, this is possible, you’ll need to have some knowledge of the CSS to use to get the effect you want, but it is possible to set a different color for each selection. The plugin has a place to put special CSS rules like that.
Great! I do have knowledge of CSS, so can you give me a hint or a line of code, how to do this? Like: “Bar/Restaurant” should appear with red background as a radio button, next radio button should be orange, saying “Cafe”, both in the same field. Thanks in advance!!!
With CSS, you need to use a selector that will target the specific element you want to color. I can’t give you the code to use, it will be specific to your situation. Typically, with a radio button, you would be setting the background color of the “label” element that wraps both the button itself and the label text. Each label has a “for” attribute which you can use to target the specific selector…for example:
You have to inspect the HTML source to see what it should be in your case.
Thanks a lot! It worked for me and it looks great! I even have been able to change the font color on this labels!
Now I go for the Multiple Databases…
Just to let you know: with my Moz-Browser (didn’t test amy other), the whole comment-field is shown twice on each page…
Hi Roland, the pictures are missing here!
Thanks, I fixed it.
I agree the comment policy