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

DateInput ClientEvents not working

2 Answers 177 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Chris McGrath
Top achievements
Rank 1
Chris McGrath asked on 08 Jul 2010, 10:52 PM
Hi, I'm trying to use some of the client events of the DateInput in the RadDatePicker and anytime I assign any of the client events a function, not only do they not work, but the date validation stops running and clicking the calendar icon does not bring up the calendar.

One example is as follows:

<telerik:RadDatePicker ID="rdpNotifyDate" runat="server">
    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
    <DatePopupButton HoverImageUrl="" ImageUrl="" />
    <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy">
        <ClientEvents OnBlur="blur();" />
    </DateInput>
</telerik:RadDatePicker>

I can put any code in the blur() function, none of them work (alerts, changing the values of controls on the page, even nothing at all).  Just having that assignment to do something OnBlur stops the control from working. 

I've tried using the OnFocus and OnValueChanged clientevents as well, with the same results.

Just for fun I even tried to create a new RadDatePicker on a different page:

<telerik:RadDatePicker ID="rdp" runat="server" ClientEvents-OnDateSelected="alert('hello');"></telerik:RadDatePicker>

Without the client event, it works.  With the event, nothing works.. no calendar popup, no date validation.

Thanks in advance,

Chris

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Jul 2010, 09:21 AM
Hello Chris,

The event handler is not assigned correctly and you get Javascript errors on the page.

A function name should be assigned without brackets:

<ClientEvents OnBlur="blur"  />

http://www.telerik.com/help/aspnet-ajax/input_clientsideonblur.html

Kind regards,
Dimo
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
0
Chris McGrath
Top achievements
Rank 1
answered on 09 Jul 2010, 04:04 PM
That was it, thanks. 
Tags
Calendar
Asked by
Chris McGrath
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Chris McGrath
Top achievements
Rank 1
Share this question
or