c# - Date Validation problems with JQuery .valid() method -


i'm trying change jquery date valuation en-gb culture without success. example 23rd march 2013, want enter 23/03/2013 , not 03/23/2013.

when call validation method on form returns false. i'm not getting validation error kendo, jquery method.

how can change culture setting jquery?

<script src="@url.content("~/scripts/kendo/cultures/kendo.culture.en-gb.min.js")"></script> <script>kendo.culture("en-gb");</script> ... @(html.kendo().datepickerfor(model => model.orderdate).htmlattributes(new { style = "width:150px", required = "required"  }).culture("en-gb").format("dd/mm/yyyy")) ... var isvalid = $("#orderform").valid();   // returns false if select 23/3/2013 

thanks.

put in script,and take regex here: regex validate date format dd/mm/yyyy

jquery.validator.methods.date = function (value, element) {             var dateregex = /copyregexhere/;             return this.optional(element) || dateregex.test(value);         }; 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -