Is there a certain way I need to interact with this control to enable my remote validation to work correctly?
Here is my model code for the property using remote validation:
<Remote("CheckAge", "Contact", "Invalid date of birth")> _<DataType(DataType.Date)> _<Display(Name:="DateOfBirth", ResourceType:=GetType(Resources._Global))> _Public Property DateOfBirth As Nullable(Of Date) Get Return Contact.DateOfBirth End Get Set(ByVal value As Nullable(Of Date)) Contact.DateOfBirth = value End SetEnd PropertyHere is my method in the Controller:
Public Function CheckAge(DateOfBirth As String) As JsonResult 'Do some validation.... 'Return result Return If(DateOfBirth Is Nothing, Json(True, JsonRequestBehavior.AllowGet), _ Json(String.Format("{0} is not available.", DateOfBirth), JsonRequestBehavior.AllowGet))End FunctionAny Advice would be much appreciated!
6 Answers, 1 is accepted
Unfortunately, this is not a known issue. Could you please send us a simple test project, which reproduce the depicted issue? Thus I will be able to observe it locally and advice you further.
Georgi Krustev
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
There should be no issues with this scenarios. I was not able to reproduce the issue related with the selected date from calendar. Remote validation fires correctly on my end. I will need test project which reproduces the depicted issue in order to review it locally and advice you further.
Georgi Krustev
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Thank you!
Here is a test project which shows how to implement remote validation.
Georgi Krustev
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
I have a scenario where in the Telerik datepicker is not firing the remote validation when I select a date from the datepicker (which is the on change event of datepicker). Once it fires the validation and it has the value of the previously selected date.
It works when i enter the value in the text box of the date picker and hit tab.
My code is
view.cshtml
@Html.EditorFor(model => model.InjuredDOB)
@Html.ValidationMessageFor(model => model.InjuredDOB)
Model.cs
[
DataType(DataType.Date)]
[
Display(Name = "Date Of Birth")]
[
Remote("ValidateInjuredDOB", "Case", HttpMethod = "Post", ErrorMessage = "Invalid")]
public DateTime? InjuredDOB { get; set; }
controller.cs
public
ActionResult ValidateInjuredDOB(string injuredDOB)
{
if (NotGreaterThanToday(injuredDOB))
return Json(true);
return Json(false);
}
At the moment the Jquery version im using is jquery-1.5.js.
Kindly provide any workable solution.
Regards
Nandha
Kindly