-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Recommendation for multi-checkbox inputs? #33
Comments
It should be easy but on the second thought... It's doable in a hacky way but it's not what we want. It seems like there is a need for a new component - same as |
I've got another idea - how about a |
I agree, that is how I've seen it done with other form systems. Then the On Sat, Jun 18, 2016, 7:00 AM Radosław Miernik notifications@github.com
|
I'll take care of this now. |
It's the same for radio-buttons: List of radiobuttons are equal to select with single value List of checkboxes are equal to select with multivalue |
Dear @radekmie, As I trying to allow multiple values for a single field, I am running into trouble. A list of checkboxes shows up in the client, but I can only select a sinlge value (single checkbox checked). I thought the checkboxes prop in the schema should do the trick. Any suggestions how should I change the implementation? I am using uniforms version 1.0.1
|
Try |
Yeah @GoaGit - @zeroasterisk is right. Your field has a |
Thanks @zeroasterisk, @radekmie, this is the appropriate way. However, my problem appears to be SimpleSchema related. The example provided is based on schema that is created from a base schema. SimpeSchema provides the pick method to create a new schema: // MyCollection has the baseschema attached to it. I select one field "Category" in this case:
This throws an error because of the I duplicated the schema for now and this works. |
Let me guess - Meteor-Community-Packages/meteor-simple-schema#514? |
Yeah - you can't "pick" for an nested/arrayed fields. I've been splitting the object you pass into the SimpleSchema constructor into it's own "config" object... I can pick from those, and then pass into various SimpleSchema's with my composed/picked/varried configurations, at the end of the file. eg:
|
Thanks @zeroasterisk, your suggestion works. @radekmie: I don't now if it is related to the issue you mentioned. (Note: Picking from array fields appears to be possible. E.g. this works for me:
followed by
and
) |
@GoaGit: that's the exact reason of this issue. |
@radekmie, confirmed. Thanks. |
What is your recommendation for multi-checkbox inputs?
Ideally I want to return an array of values, for all checked checkboxes, and specify them as
uniforms.options
The text was updated successfully, but these errors were encountered: