Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow commas in comma separated form choices #166
Comments
A nice backwards-compatible workaround that I manually implemented on a previous site: simply override the radio/checkbox/choice fields to be pipe delimited if they contain a pipe, otherwise behave as usual (comma delimited). |
Hi, @vsalvino where are we using this exactly? I've just set up the environment and was going through the documentation |
In the Wagtail admin, create a Form Page. Then, while adding fields, if you add a dropdown, checkbox, radio (any kind of multi-select) there is a text/char field for choices. This char field expects comma delimited choices. For example, the text:
HOWEVER - if you need an option containing a comma, it is currently not possible. As a workaround, separating items with a PIPE character For example:
The code would need to be added to CoderedFormBuilder to extend built-in functionality in Wagtial's FormBuilder, when creating dropdown, multiselect, radio, etc. fields. coderedcms/coderedcms/forms.py Line 109 in 929b4df |
It is a common use-case to require a comma in a form choice, such as "Please specify your income: $1,000 - $2,000" etc. I think it would be preferable to use pipe separator since it is not an English grammatical character.
While we do have a very customized form page, we are still leaning on some underpinnings of wagtail.contrib.forms, so I think we will either need to provide our own choice field, or make a contribution to wagtail to support changing it from the hard-coded comma.