CrazyPaste CrazyPaste - 5 months ago 44
HTML Question

JavaScript error: Uncaught TypeError: a[b] is not a function

In my C# Webforms project I have a

control set to run a
function. Each time I select a date, I get this Javascript error:

Uncaught TypeError: a[b] is not a function

function SetDateSession() {

<telerik:RadDatePicker ID="StartDatePicker" runat="server">
<ClientEvents OnDateSelected="SetDateSession()" />

I can't figure out why this very simple code doesn't work. If I try to call the function with
from an
tag, it works.

<input type="button" id="RepBtn" onclick="SetDateSession()" value="View" runat="server"/>

Here is the console when I get the error:

enter image description here

I've simplified the code so much that it's hard for me to know what to try next.


What a waste of time on such a stupid thing! Basically this

<ClientEvents OnDateSelected="SetDateSession()" />

should be this

<ClientEvents OnDateSelected="SetDateSession" />

Lesson learned, Telerik! Thank you.