-
Notifications
You must be signed in to change notification settings - Fork 250
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
Validation: Highlight the required fields when a user submits a form #1576
Comments
This is related #544 |
can you please share the questionnaire? @Itskiprotich thanks |
@Itskiprotich The reason that we do not show all these validation errors is because we do not want to spam the user when they first open the questionnaire. We discussed this with @mberg @f-odhiambo @shelaghm. Showing all these validation errors at the same time when the user first open the questionnaire is considered as an unhelpful pattern. Unless there's a differernt solution, I will just mark this as a duplicate issue as #544 as @f-odhiambo suggested. EDIT: please feel free to reopen if you have additional comments or disagree. |
@Itskiprotich can you confirm if you can use the submit button provided by the library (which uses the fragment results API)? rather than calling the Discussed with @aditya-07 and @shelaghm. It remains a question what the questionnaire behavior should be when there are either validation errors on the last page, or previous pages (in the case of random entry mode, you can navigate to the next page without having completed everything in the current page, so it's possible that when you're on the last page, there're still unanswered questions in previous pages). Should we have a pop-up dialog? an inline widget? a toast? or some kind of more flexible API for developers to provide feedback to the user however they like. |
I think a pop-up dialog that is displayed when a user presses "submit" can work well here because we want to alert people take action and fix the issues. There should also be error messages already displayed in the form if they haven't completed required questions or there's validation errors. What do you think of this approach @aditya-07 and @jingtang10? |
Discussion with Jing: How to show the questionnaire has fields that are incomplete in the patient card? |
Sorry for the delay. Attached is the questionnaire I'm using. |
i think in the V1 we should have "complete fields" and "submit anyway" buttons in the dialog just because in some cases the healthworker might want to save a draft questionnaire |
@shelaghm i think the text in the dialog needs to be more generic. "complete all required fields" doesn't cover the cases where validation is failing for other reasons, e.g., value too large/small, text too long/short etc. |
@jingtang10 How about some of these options? Is |
@shelaghm nit: let's use anyway instead of anyways since anyways is the informal version of anyway. |
@jingtang10 sounds good, I'll make the change in my mocks |
Is your feature request related to a problem? Please describe.
With the SDC beta04, when I try to submit a form with unanswered required fields, it's hard to tell which field is required since the highlight only appears when a user interacts with a specific input field. Is it possible to allow the validators be seen at a glance?
Describe the solution you'd like
Is it possible to have all the required fields marked as shown below in the screenshot?
Describe alternatives you've considered
![Screenshot_20220831_094028](https://user-images.githubusercontent.com/26279422/187613624-11118401-cee8-4bc5-b0c0-c695e999e67b.png)
None
Additional context
The text was updated successfully, but these errors were encountered: