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

Ability to set validations as warning only #9085

Open
digiscapeuk opened this issue Nov 21, 2024 · 10 comments
Open

Ability to set validations as warning only #9085

digiscapeuk opened this issue Nov 21, 2024 · 10 comments
Assignees
Labels
user issue An issue or bug reported by users

Comments

@digiscapeuk
Copy link

Is your feature request related to a problem? Please describe.
There are cases where it's desirable to define validations on an item to show a warning message but the user should not be blocked from saving the survey.

Describe the solution you'd like
Validations have an additional property to "allow save". When these validations trigger they appear on screen & the user can be prompted on survey submit with configurable text e.g. "This survey has the following validation warnings: {list}. Press Ok to Save or Cancel to amend the survey".

Describe alternatives you've considered
Custom expression items that use visibility rules to show/hide them and custom code on save.

@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 22, 2024

Hello @digiscapeuk,
Thank you for your inquiry. Do you wish to be able to specify the 'warning' validation mode for a particular form element? For the record: you can disable the survey.validationEnabled option for the entire survey. Regardless of the validation errors, users will be able to submit a form.

@JaneSjs JaneSjs added the user issue An issue or bug reported by users label Nov 22, 2024
@digiscapeuk
Copy link
Author

digiscapeuk commented Nov 22, 2024 via email

@andrewtelnov
Copy link
Member

@digiscapeuk Why don't use requiredIf functionality for this case?

Thank you,
Andrew

@digiscapeuk
Copy link
Author

digiscapeuk commented Nov 22, 2024 via email

@andrewtelnov
Copy link
Member

@digiscapeuk Could you please describe your scenario in more detail? It would be better to be more specific, for example, stating that question 1 depends on question 2. If the value in question 2 is X, then question 1 should have a value like...

There are many options available, and I believe you can create a good UI using a combination of existing options along with some coding. Here are some statements:

  • You can store the survey results (survey.data) at any time you want.
  • You can mark additional options in your survey response as completed/valid, incomplete/invalid, and so on. You have the flexibility to set survey.data or any question value at any point from your code.
  • You can display errors when a question value changes, when navigating to the next page (default behavior), when completing the survey, or you can choose to ignore errors altogether.
  • You can implement additional code that, upon "completing" the survey, will present your UI where you can propose to save it as is or make corrections. If a user chooses to correct their answers, you can either show the entire survey with the first problematic question or create a survey containing only the problematic questions.
  • You can utilize requiredIf and expression validators, as I suggested, to show errors based on the values of other fields. You can add/remove/modify questions errors in the code, based on your logic.

There are numerous options available.

Thank you,
Andrew

@digiscapeuk
Copy link
Author

digiscapeuk commented Nov 23, 2024 via email

@digiscapeuk
Copy link
Author

digiscapeuk commented Nov 23, 2024 via email

@andrewtelnov
Copy link
Member

@digiscapeuk The problem I have with your suggestion is that I’m not sure it is a good UI solution. Your goal is to bring your users' attention to a potential issue. An error that doesn't require any action will not be very helpful; a user will only see it if there is another error associated with the same question. Otherwise, it will likely be ignored and not seen by the user at all. It could be noticed if all of these are true:

  • The question is not the last one on the page.
  • Error validation mode is set to "on value changed"
  • The question title remains visible when moving to the next question.

I would propose a better UI solution where the user is required to take action.

Thank you,
Andrew

@andrewtelnov andrewtelnov self-assigned this Nov 24, 2024
@digiscapeuk
Copy link
Author

digiscapeuk commented Nov 24, 2024 via email

@andrewtelnov
Copy link
Member

@digiscapeuk Could you please provide a small part of your survey/form that illustrates the problem? It would be better to discuss the issue based on a real case in order to find the best UI solution. We will be able to create a small example using the actual JSON.

Thank you,
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

3 participants