WebUIValidation.js and Latvian[lv]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top