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

[Solved] Form Validation & Other Properties Questions

2 Answers 127 Views
DatePicker for HTML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Randy
Top achievements
Rank 1
Randy asked on 10 Jun 2013, 11:42 PM
Hi,
I started to use the html date picker (ver 2013.1.417) on our project and ran into several issues.
I think they are fatal flaws and will force us to have to use something else like the MS Win8 SDK datepicker.
It would be great if I'm wrong, so:

1. Can I have the control initialized with certain dates disabled?  In most of my scenarios, my customers can only select weekdays (and then I also have some custom weekdays that are unavailable, i.e. company holidays)

2. The biggest issue it seems is validation. This control really needs to tie into html5/windows store form validation.
I need this picker to be able to have properties such as ".required" & ".setCustomValidity".
It needs to tie into a form when I ask the submit event if "event.target.checkValidity()" is valid or not.
And it needs to tie into the built in form input styles.

#elementname input:valid {
}
 
#elementname input:invalid {
    border:solid red;
    font-weight:bold;
}
 
#elementname input:required{
}
 
#elementname input:optional{
}  


Any thoughts or insights are appreciated.
(or send these thoughts on to the dev team for consideration for a future release.)

Thanks,
Randy

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 11 Jun 2013, 01:31 PM
Hi Randy,

The design of the RadDatePicker control is such that it is not aware of week days and weekends. In your scenario, it may be better to use the new RadCalendar control (officially available from tomorrow, now in Beta). It allows you to select dates and to customize its behavior to ignore weekend days selection.

Since you want to validate this selection, you should better tie the RadCalendar selection to an input element, which you can easily validate.

You can find an example using such approach attached to this message. It handles the weekday selection only logic and makes sure that only dates selected in the calendar are set to the input. You can get the selected date object, using the hidden input added right before the input element. Furthermore, the calendar has some custom styles applied to the weekends, so they look disabled.

Give the example a try and let us know if there is anything unclear about the implementation.

Also, note that this is just a sample implementation, you can change the approach or customize the logic to better fit your scenario.

Regards,
Tsvetina
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Randy
Top achievements
Rank 1
answered on 11 Jun 2013, 06:47 PM
Thanks Tsvetina,
I'll give it a look.
Randy
Tags
DatePicker for HTML
Asked by
Randy
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Randy
Top achievements
Rank 1
Share this question
or