【发布时间】:2012-05-07 06:44:36
【问题描述】:
我正在制作一个表格,老年人必须使用它来注册医疗服务。 (学校项目) 我想这样做,如果输入的字符数少于或多于警报框的允许字符数,以说明他们在最后一个密码中输入了多少字符,以显示他们出错的地方。我已经编写或者更确切地说是复制和编辑了验证代码。
if (pw.length < o.length[8] || pw.length > o.length[25])
alert("Your password must be between 8 to 25 chacters. The one you entered had * characters")
//Would have to remember how many were entered, and then produce it
return false;
我做了一些我找不到的研究。 但是,如果您对我的工作方式有一些建议,我将不胜感激。
【问题讨论】:
标签: javascript validation passwords character counting