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

Invalid (free-form) select component values? #3690

Closed
shawnbot opened this issue Jan 22, 2021 · 4 comments
Closed

Invalid (free-form) select component values? #3690

shawnbot opened this issue Jan 22, 2021 · 4 comments

Comments

@shawnbot
Copy link
Contributor

We've discovered some instances (a very small fraction: 64 out of ~100k) of submissions with what appear to be free-form values in a select component using the Choices.js widget. It's not exactly dire because the number of bad rows is manageable, but it could be an issue for us in the long term because data integrity on this field is important.

My hunch is that this is a browser compatibility issue in Choices.js and/or formio.js, and that a JS error is allowing the component to accept whatever value is in the search input. We've been flushing the submissions from form.io to remove PII so I don't have the browser metadata handy, but I'm curious if anyone has seen this before.

@travist
Copy link
Member

travist commented Jan 22, 2021

We have introduced a new validation on Select components that will validate the value to ensure it is a selectable option. It is an optional validation and can be found on the new renderer @

https://monosnap.com/file/uVLw9Bsgp2lunxLgTspTaupUhwERV0

Will this work for your case?

@shawnbot
Copy link
Contributor Author

shawnbot commented Jan 23, 2021

@travist That works, but how do I use it? Do we need to upgrade our portal and formio.js?

@travist
Copy link
Member

travist commented Jan 25, 2021

This is part of our 4.13.x release, which is still in RC and we have some known regressions and bugs. Because of this, I would say we need to wait to use it as part of a production release, but if you wish to try it out, then you can upgrade your renderer in your application with this renderer version and then using the Edit JSON feature of the form builder, you will add the following to the select component.

{
  "validate": {
    "onlyAvailableItems": true
  }
}

@olgabann
Copy link

olgabann commented Feb 7, 2024

We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

@olgabann olgabann closed this as completed Feb 7, 2024
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

3 participants