PDA

View Full Version : [CLOSED] Form Date Field marks itself as required



registrator
May 05, 2015, 10:39 AM
I have the following model and editor



public DateTime FIRST_INVOICE { get; set; }




X.DateFieldFor(m => m.FIRST_INVOICE).FieldLabel("").ReadOnly(true).LabelWidth(0).Width(90).AllowBlan k(true),


This value and filed should not be required, however, when I try to save the form, at ModelState.IsValid I get that this field is required. I thought that AllowBlank would solve it but it didn't.
How do you solve this issue please?

Thank you

Daniil
May 05, 2015, 3:29 PM
Hi @registrator,

The reason of the behavior is the same as here:
http://forums.ext.net/showthread.php?57951&p=267121&viewfull=1#post267121

And .AllowBlank(true) does work for me.

That is difficult to say why it doesn't work for you.