Javascript alert doesn't print telerik datepicker value if it's a string

39 Views Asked by At

I'm trying to show a value I typed in a Telerik RadDatePicker control:

function validateDates() {

    var date1 = $('<%= RadDatePicker1.ClientID %>');
    alert(date1.value);
    return true;
}

When the sate is valid like 1/23/2009, it prints it, if I type a string value or leave it empty, the alert doesn't show anything.

Why is that?

I'm trying to validate the values before calling the server and need to figure this out.

Let me know please, what I'm missing.

1

There are 1 best solutions below

0
On

Get the reference to the client side component with $find and use its own client API, there should be something like .get_value()