Enhancement of Required-Validation - Mendix Forum

Enhancement of Required-Validation

0

Hi Everybody!

I noticed some strange behaviour regarding the validation of required fields. It is enough to simply press Space and this (more or less) empty field will pass the validation.
My understanding of a required field would be to actually have some content. Of course you can write your own validation, but it would be interesting to know why this implementation was used - maybe there is some good idea behind it?

 

Best Regards,
Florian

asked
3 answers

The forms have great validation options for `required` validation on the data model can use regex

 

 

Created

Yes of course - I also do that at the moment. Still, I think it would make sense that a Space-Char does not pass the validation, since it holds as much information as no input at all.

Created

As space is a character it seems logical that this required validation will pass when entering a space char.

This can be solved with a custom validation that trims the field value before checking.

Created