Unobtrusive validation warnings (not errors)

How can I create a warning level notification on top of the built-in unobtrusive check?

A fully compiled example: I allow people to indicate how long they will wait for tables from the start of their reservation. It should be from 0 to 12 hours (there are no negative expectations, and there was nothing closing time), but you can also ask β€œare you sure” about the 5-hour wait?

Obviously, you could do this one-time in the field by field field, but I would like to have it based on the attributes of the data model, since where I would have the β€œ0 to 12” check.

So, from my head, I see the need for what extends ValidationAttribute and implements IClientValidatable. I also need to add my validator validation method to a custom JavaScript file. This is true?

+6
source share

Source: https://habr.com/ru/post/910392/


All Articles