Quasar: [Feature Request][Dialog] Error messages in form field

Created on 30 Aug 2017  路  7Comments  路  Source: quasarframework/quasar

We need to validate user's input, and there is more than one field in the form in dialog, it's not a good user experience to create a new popup to tell the user there are some errors in fields.

Most helpful comment

Hi,

This is a very complicated issue. I see many requests like "add this and that to Dialog". Dialog should be a very lightweight component. If you need a specific behaviour, you can design your own Modal for it.

Validation is especially something that I wouldn't like to add to this component because you need a validation library and there are plenty to choose from. Some want to work with a specific validation library, some want with another. Cannot make something to please everybody.

So, the solution is to design your own minimized Modal which will best fit your needs.

All 7 comments

http://quasar-framework.org/components/field.html allows you to set a custom error message for each component that you wrap with a field tag. You should be able to get the desired behaviour from it.

@spectrolite we cannot custom the component inside the Dialog component. http://quasar-framework.org/components/dialog.html#Dialog-with-Form-Components

I agree that it doesn't seem like we are able to use error messages in dialog. I'd like to extend vuelidate into dialogs as they contain form fields that need validation and error messaging.

Hi,

This is a very complicated issue. I see many requests like "add this and that to Dialog". Dialog should be a very lightweight component. If you need a specific behaviour, you can design your own Modal for it.

Validation is especially something that I wouldn't like to add to this component because you need a validation library and there are plenty to choose from. Some want to work with a specific validation library, some want with another. Cannot make something to please everybody.

So, the solution is to design your own minimized Modal which will best fit your needs.

I think that a simple warning in the Dialog docs would avoid many of these issues. Many newcomers don't realize that Dialog is a "specialized" Modal, so it's not (yet) an "automatic reflex" to go and use Modal instead.

Dialog should be a very lightweight component. If you need a specific behaviour, you can design your own Modal for it.

simply this should do the trick imho

Care to do a PR on docs pls? @spectrolite

Was this page helpful?
0 / 5 - 0 ratings