Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comma in select field value does not render in form #107

Open
stevepiercy opened this issue Feb 11, 2015 · 1 comment
Open

Comma in select field value does not render in form #107

stevepiercy opened this issue Feb 11, 2015 · 1 comment
Labels
Milestone

Comments

@stevepiercy
Copy link
Member

When a select field has a value that includes a comma, e.g., "Stockton, CA", and the user selects that option from the select menu and submits the form, Knop will write the value to the database and everything else, but it will not render the field with the value selected when the record is loaded a subsequent time.

@stevepiercy
Copy link
Member Author

This is the line that breaks select options in both versions of Knop.
https://github.com/knop-project/knop/blob/master/knop8/source/_ctype/form.inc#L1328
https://github.com/knop-project/knop/blob/master/knop9/knoplibs/knop_form.lasso#L1454

#fieldvalue_array = #fieldvalue_array -> (split: ',');

One could not use commas in their field values for checkboxes, radios, or selects, but that's a poor option.

The better option is to modify form.inc to accept an optional parameter flag -singlevalue with a default value of false for a given radio or select field. Then when the developer sets it to true, Knop will not split on the single value that contains commas.

stevepiercy added a commit to stevepiercy/knop that referenced this issue Feb 21, 2015
…s which have values containing commas can be rendered "checked" or "selected" when those values have been checked or selected after loading the field. Addresses issue for Knop for Lasso 8 only. Still need to do Lasso 9 version. See Issue knop-project#107.
stevepiercy added a commit that referenced this issue Feb 24, 2015
forget to declare a local for singlevalue in the form->renderhtml method.

See #107
@stevepiercy stevepiercy added this to the 0.2 milestone Jul 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant