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

Cleaning choices such as value of HTML select #9

Open
IlyaSemenov opened this issue Dec 29, 2018 · 2 comments
Open

Cleaning choices such as value of HTML select #9

IlyaSemenov opened this issue Dec 29, 2018 · 2 comments

Comments

@IlyaSemenov
Copy link
Owner

Add clean.any({ choices }) which will only accept one of predefined values.

@tomanagle
Copy link

@IlyaSemenov could there also be a clean.skip method? I sometimes want to allow empty arrays for certain values. A skip method should allow me to define the values that I don't ant to be included in the clean function.

@IlyaSemenov
Copy link
Owner Author

I think this issue is about something different so I opened an another issue for skipping elements.

This particular issue is about cleaning a form <select> or similar cases where a user is only allowed to pick a certain value.

The problem is, if I add choices to clean.any then the values won't be pre-cleaned (e.g. numbers won't be casted from strings). But if not, it will need to be duplicated in each cleaner.

I put it on hold until I decide how to arrange it properly. Perhaps it will be an aggregating cleaner like clean.choices() instead of the new option.

@IlyaSemenov IlyaSemenov changed the title Add clean.any({ choices }) Cleaning choices such as value of HTML select Jan 9, 2019
@IlyaSemenov IlyaSemenov removed the hold label Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants