This question is locked. New answers and comments are not allowed.
What's the best way to call a javascript function that takes a couple of parameters when the date is changed?
I have a function in my .js file:
function AddNumbers(a,b){
return a+b;
}
I've tried:
<%= Html.Telerik().DatePicker()
.Name("myID")
.ClientEvents(events => {events.OnChange("AddNumbers(1,2)");})
%>
and
<%= Html.Telerik().DatePicker()
.Name("BusinessTaxReceipt.LicenseExpirationDate")
.InputHtmlAttributes(new { onchange = "AddNumbers(1,2)" })
%>
I even tried wiring up a jQuery blur event to the control, but it seems to be firing at the wrong time (usually when a date is selected and before the textbox value is actually changed), so in the blur event method when i get the value it gets the value in textbox which hasn't been updated at that point.
Any ideas? Thanks.
Ozzie
I have a function in my .js file:
function AddNumbers(a,b){
return a+b;
}
I've tried:
<%= Html.Telerik().DatePicker()
.Name("myID")
.ClientEvents(events => {events.OnChange("AddNumbers(1,2)");})
%>
and
<%= Html.Telerik().DatePicker()
.Name("BusinessTaxReceipt.LicenseExpirationDate")
.InputHtmlAttributes(new { onchange = "AddNumbers(1,2)" })
%>
I even tried wiring up a jQuery blur event to the control, but it seems to be firing at the wrong time (usually when a date is selected and before the textbox value is actually changed), so in the blur event method when i get the value it gets the value in textbox which hasn't been updated at that point.
Any ideas? Thanks.
Ozzie