最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to only allow text in parsely.js validation - Stack Overflow

programmeradmin0浏览0评论

I am using the nifty parsley js As you can see in the documentation there is only data-parsley-type="alphanum" which allows numbers and letters. I am trying to create fields that ONLY allow letters.

Anyone know how to do this?

I am using the nifty parsley js As you can see in the documentation there is only data-parsley-type="alphanum" which allows numbers and letters. I am trying to create fields that ONLY allow letters.

Anyone know how to do this?

Share Improve this question asked May 1, 2014 at 20:12 user2684452user2684452 7313 gold badges14 silver badges34 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 19

You could use a pattern:

data-parsley-pattern="^[a-zA-Z]+$"

You can use such input validator, in order to obtain an only letter field.

<input type="text" class="form-control" required data-parsley-pattern="^[a-zA-Z ]+$" placeholder="Type something" />
发布评论

评论列表(0)

  1. 暂无评论