#3759 closed defect (fixed)
Remove redundant code in dojox.validator/regexp
Reported by: | Adam Peller | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Dojox | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Happily, Dojo 0.9 provides much of this functionality and in a more "globalized" way so we can ditch a lot of the old validate code entirely.
This code should be removed in favor of dojo.currency:
- dojox.regexp.currency
- dojox.validate.isGermanCurrency
- dojox.validate.isJapaneseCurrency
- dojox.validate.us.isCurrency
- dojox.validate.ca.isCurrency
- dojox.validate.isCurrency
and these in favor of dojo.date which can provide localized regexps
- dojox.regexp.time
and these in favor of dojo.number, which also provides regexps on demand:
- dojox.regexp.integer
- dojox.regexp.realNumber
- dojox.validate.isInteger
- dojox.validate.isRealNumber
and you should probably get rid of dojox.validate.isInRange which also bypasses i18n code and just let the user use boolean operators. I guess if such an API is necessary for check, we should find a way to implement it with dojo.number. We should never require the user to specify decimal separators as arguments or other parameters which require cultural info we already handle. This should be locale driven, wherever possible. That leaves country-specific stuff like zip codes, phone numbers, state lists, which are a little bit less interchangeable anyhow.
Change History (7)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 14 years ago by
Status: | new → assigned |
---|
comment:4 Changed 14 years ago by
comment:5 Changed 14 years ago by
yup, though whatever you do, you'll have to make it work with check, should you choose to support check... and that may not belong in dojox.regexp.
note that the dijit.form.ValidationTextbox? knows how to take a regexp (regExpGen)
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
dojox.validate has been stripped of said code. again, direction uncertian, interested parties should discuss on dojox developer forums at dojotoolkit.org
taking ticket, but seek advice on best implementation. should dojox.validate be dropped for a robust dojox.regexp set all together? so people can just phoneString.match(dojox.regexp.isUsPhoneNumber) rather than just var myBool = dojox.validate.isUsPhoneNumner(phoneString)?