This is a migrated thread and some comments may be shown as answers.

DatePickerFor not using model attributes

2 Answers 135 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 23 Sep 2014, 08:13 PM
I have the Required attribute on my model, but when I use DatePickerFor, Kendo Validator does not pick that up.  If I use the F12 tools and manually add "required='required'" to the input that the DatePicker renders, then Validator picks it up and shows a message next to the picker.  Besides that, it's also not picking up the ErrorMessage on my Required attribute.  I'm assuming I could add another attribute to the <input> for it to pick that up as well, but not yet sure what the attribute name is.  Can you please explain why I can't just get this behavior out of the box, and if this is a bug with the DatePickerFor?  I'd rather not have to use .HtmlAttributes to manually stick these things onto every DatePicker.  Maybe I'm just missing something, but for something like this, you expect it to just work.  Thanks!

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 25 Sep 2014, 03:37 PM
Hi Michael,

Does this work with Html.TextBoxFor? If it doesn't then probably you are not using Html.Form. 

If it does work with Html.TextBoxFor we would like to see a runnable project that shows the problem. You could prepare one and attach it here.

Regards,
Atanas Korchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Michael
Top achievements
Rank 1
answered on 29 Sep 2014, 05:05 PM
Sorry for the delay.  We use another helper (TwitterBootstrapMVC) around yours in order to get Bootstrap styling for our form elements, and it appears to be related to that instead.  I have sent a demo project to the developer of that project to see if they can assist further.  Thanks!
Tags
Date/Time Pickers
Asked by
Michael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or