jQuery validate - how do I ignore letter case?

后端 未结 5 2183
无人共我
无人共我 2021-02-20 16:08

Probably a goofy question, but I can\'t seem to find anything in google land. I simply need one of my methods to ignore the case of the entered field. I am doing a city name mat

5条回答
  •  旧巷少年郎
    2021-02-20 16:34

    return (value ? value.match(/atlanta/i) : null) != null
    

    This is case insensitive and you can do lots of fun stuff with the regex. Enjoy. And please don't do "Cosntant".toLowerCase() there is just too much wrong in that.

提交回复
热议问题