I hereby claim:
- I am sdedelbrock on github.
- I am shiem (https://keybase.io/shiem) on keybase.
- I have a public key whose fingerprint is 052C 092E 063F 5A15 0171 3E68 FE04 9BE6 4088 8C64
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var validate = { | |
//returns false if error | |
text:function(val){ | |
return (val.length < 2) ? false : true; | |
}, | |
phone:function(val){ | |
val = (val.charAt(0) == 1 || val.length == 11) ? val.substring(1) : val; | |
var phoneRe = /^[2-9]\d{2}[2-9]\d{2}\d{4}$/; | |
var digits = val.replace(/\D/g, ""); | |
return (digits.match(phoneRe) !== null); |