Bug in ValidatorConvert function in WebUIValidation.js

  • Thread starter Thread starter Frank Rosario
  • Start date Start date
F

Frank Rosario

I'm currently developing under WinXP and have the latest .Net
distribution with Visual Studio 2k3.

While working on a company project, I came across this bug. I was
using a compareValidator: dataTypeCheck for a double. User input was
"-" (sans quotes).

When the user submitted, it runs the validation and PASSES even though
it should have failed. After some investigation, I realized this was
because the ValidatorConvert function was taking the "-" and turning it
into a zero.

Anybody know of any fixes for this; other then hijacking
ValidatorConvert and adding wrapper function to check for the case
above and handling accordingly?
Note: the bug also affects rangeValidator as well.
 
Frank..
If thats the case then the BEST bet is to write your own custom
validator..
Enjoy
Patrick
 
the ValidatorConvert when it converts a number allows a leading sign (+
or -):

- is the same as -0 which is 0
+ is the same as +0 which is 0

there is no built in support for unsigned numbers, use the reg expression
validator instead.

-- bruce (sqlwork.com)




|
| I'm currently developing under WinXP and have the latest .Net
| distribution with Visual Studio 2k3.
|
| While working on a company project, I came across this bug. I was
| using a compareValidator: dataTypeCheck for a double. User input was
| "-" (sans quotes).
|
| When the user submitted, it runs the validation and PASSES even though
| it should have failed. After some investigation, I realized this was
| because the ValidatorConvert function was taking the "-" and turning it
| into a zero.
|
| Anybody know of any fixes for this; other then hijacking
| ValidatorConvert and adding wrapper function to check for the case
| above and handling accordingly?
| Note: the bug also affects rangeValidator as well.
|
 
Back
Top