7 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 04 Feb 2010, 05:54 AM
Hello,
Try the following approach in order to show error message when typing invalid date in DatePicker.
ASPX:
JavaScript:
-Shinu.
Try the following approach in order to show error message when typing invalid date in DatePicker.
ASPX:
<telerik:RadDatePicker ID="textBoxDOB" Skin="Web20" Culture="en-US" runat="server"> |
<DateInput ClientEvents-OnError="OnError" runat="server"> |
</DateInput> |
</telerik:RadDatePicker> |
JavaScript:
<script type="text/javascript"> |
Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate) |
{ |
if (new Date(value) != "NaN") |
return value; |
} |
function OnError(sender, args) { |
alert('Invalid date'); |
} |
</script> |
-Shinu.
0
newbie
Top achievements
Rank 1
answered on 04 Feb 2010, 05:28 PM
Hi Shinu,
This does not work for me.
I get a js error that 'Telerik.Web.UI.RadDateInput.prototype' is null or not an object'.
I am using the latest Telerik controls.
Can you give me a working example?
This does not work for me.
I get a js error that 'Telerik.Web.UI.RadDateInput.prototype' is null or not an object'.
I am using the latest Telerik controls.
Can you give me a working example?
0
Hello Anumeha,
The error is caused by the fact that the RadDatePicker client namespace has not been registered. Probably you are displaying the picker after an AJAX request. If so, you must execute the custom script after the AJAX request, not on initial load. Include the script in another fuction, e.g.
function executeAfterAJAX()
{
if (typeof(Telerik.Web.UI.RadDateInput) != "undefined")
{
Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)
{
if (new Date(value) != "NaN")
return value;
}
}
}
Kind regards,
Dimo
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
The error is caused by the fact that the RadDatePicker client namespace has not been registered. Probably you are displaying the picker after an AJAX request. If so, you must execute the custom script after the AJAX request, not on initial load. Include the script in another fuction, e.g.
function executeAfterAJAX()
{
if (typeof(Telerik.Web.UI.RadDateInput) != "undefined")
{
Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)
{
if (new Date(value) != "NaN")
return value;
}
}
}
Kind regards,
Dimo
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
newbie
Top achievements
Rank 1
answered on 08 Feb 2010, 09:22 PM
I am sorry if I am not getting this right.
So where should I call the function executeAfterAJAX() ?
So where should I call the function executeAfterAJAX() ?
0
Hi Anumeha,
It depends on your AJAX implementation. For example, you can call the function in the OnResponseEnd handler of RadAjaxManager.
http://www.telerik.com/help/aspnet-ajax/ajxonresponseend.html
See also
http://www.telerik.com/help/aspnet-ajax/ajxcustomjavascript.html
Regards,
Dimo
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
It depends on your AJAX implementation. For example, you can call the function in the OnResponseEnd handler of RadAjaxManager.
http://www.telerik.com/help/aspnet-ajax/ajxonresponseend.html
See also
http://www.telerik.com/help/aspnet-ajax/ajxcustomjavascript.html
Regards,
Dimo
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Howard
Top achievements
Rank 1
answered on 15 Jan 2015, 10:22 PM
WHY DON'T THESE EXPENSIVE CONTROLS WORK WITH THE .NET VALIDATORS?
0
Hi Howard,
Can I kindly ask you to provide additional details for the issue you are facing with the integration between RadControls and the asp validators controls?
We do not have some general issues reported for such scenarios and we are not aware of such incompatibility.
You can check the online demos below that presents the proper behavior of such scenarios:
http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/datetimepicker/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/monthyearpicker/validation/defaultcs.aspx
Regards,
Maria Ilieva
Telerik
Can I kindly ask you to provide additional details for the issue you are facing with the integration between RadControls and the asp validators controls?
We do not have some general issues reported for such scenarios and we are not aware of such incompatibility.
You can check the online demos below that presents the proper behavior of such scenarios:
http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/datetimepicker/validation/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/calendar/examples/monthyearpicker/validation/defaultcs.aspx
Regards,
Maria Ilieva
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.