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

DatePicker filled or not

1 Answer 53 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikhil Kashyap
Top achievements
Rank 1
Nikhil Kashyap asked on 02 Aug 2010, 07:56 AM
Hi,
    I need to disable certain things in my javascript method based on check - whether DatePicker Textbox contains a date or not.. Could you plz tell how to check for this.

Also let me know how to clear/empty the value of DatePicker Text through javascript.

Regards Nikhil Kashyap
Customer ID: JT359876

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Aug 2010, 01:06 PM
Hello Nikhil Kashyap,

I will suggest you check this online help article in order to understand whether one date is valid. To determine whether the typed date is valid, you need to check whether the input has "t-state-error" CSS class:
var hasError = $('#DatePicker').find('.t-input').hasClass('t-state-error')'
if(hasError)
//date is not valid.
else
//date is valid.

You can empty datepicker with this code snippet:
$('#DatePicker').data('tDatePicker').value(null)
Here you can find more information about Client API of the component.

Greetings,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Date/Time Pickers
Asked by
Nikhil Kashyap
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or