Skip to content

Conversation

@raulrpearson
Copy link
Contributor

This PR adds a new field during form creation that enables users to mark fields as optional. The wording I chose is "required" rather than "optional" because I think the resulting language and logic is more natural. As far as I can tell, this works with existing forms in the database by virtue of the field being optional and defaulting to true.

optional-form-fields

A couple of highlights to keep in mind:

  • I added a limited set of the daisyUI plugin on app.css so that I could just use an HTML checkbox input and style it with the toggle class. I feel we've got a lot going on in the assets folder that we could clean up, but felt that this change was small and convenient enough. I'd be happy to clean up cross-app styles in future PR(s).

  • We're not validating form responses. This was the case before. I did a quick research to figure out the best way to do that and couldn't find one using Ecto. I haven't added validation because of this, but if you know of a way to add this, let me know and we can improve. Maybe we can add to the backlog.

Closes #144. Let me know what you think.

@alxlion
Copy link
Contributor

alxlion commented Dec 4, 2025

It works perfectly, just a minor improvement for the attendees is to add an "optional" label on the attendee view like this one :
CleanShot 2025-12-04 at 15 55 11@2x

@raulrpearson
Copy link
Contributor Author

Good point! I'll work on adding that.

@raulrpearson
Copy link
Contributor Author

@alxlion, done! I only modified the text and email components to avoid increasing scope, but if you'd like us to add this "(optional)" suffix to every custom component, let me know and I'll work that in.

@alxlion alxlion merged commit 6dc6181 into ClaperCo:dev Dec 5, 2025
1 check passed
@raulrpearson raulrpearson deleted the optional-form-fields branch December 5, 2025 16:51
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

Successfully merging this pull request may close these issues.

Optional fields in forms

2 participants