G
Guest
Hello,
I have found a small bug in WebUIValidation.
In a page I use a CompareValidator to check that the user input date in
correct format.
When using Culture Latvian[lv] the date looks like: "2005.12.13." (note the
last dot!). I use .net framework 1.1 and version
"1_1_4322/webuivalidation.js" in my application.
My validation doesn't work in this culture and if you look up
webuivalidation.js and under function: ValidatorConvertsearch and the line:
"else if (dataType == "Date")"
you can se the following regExp:
var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\.
?)(\\d{1,2})\\4(\\d{1,2})\\s*$");
This regExp can't work with culture Latvia so you have to add "\.*\" and
then you have a correct RegExp:
var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\.
?)(\\d{1,2})\\4(\\d{1,2})\\.*\\s*$");
It is not recommended to do manual changes in webuivalidtion so I wonder if
anyone have a solution that can help to solve my problem?
Best regards
/ Quazzo
I have found a small bug in WebUIValidation.
In a page I use a CompareValidator to check that the user input date in
correct format.
When using Culture Latvian[lv] the date looks like: "2005.12.13." (note the
last dot!). I use .net framework 1.1 and version
"1_1_4322/webuivalidation.js" in my application.
My validation doesn't work in this culture and if you look up
webuivalidation.js and under function: ValidatorConvertsearch and the line:
"else if (dataType == "Date")"
you can se the following regExp:
var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\.
?)(\\d{1,2})\\4(\\d{1,2})\\s*$");
This regExp can't work with culture Latvia so you have to add "\.*\" and
then you have a correct RegExp:
var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\.
?)(\\d{1,2})\\4(\\d{1,2})\\.*\\s*$");
It is not recommended to do manual changes in webuivalidtion so I wonder if
anyone have a solution that can help to solve my problem?
Best regards
/ Quazzo