类名中的方括号是什么意思? [英] What do square brackets in class names mean?

查看:455
本文介绍了类名中的方括号是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看到 在方括号中使用类名:

 < input class =validate [required,custom [onlyLetter ],length [0,100]]name =firstnametype =text/> 

这些方括号表示什么?

解决方案

这很可能是由某种验证器或验证库使用的。这里的类意味着验证这个由 validate 关键字表示的字段,然后:

必需它是必填字段

自定义验证类型;只允许字母

长度应该在0到100个字符之间

那么,这个信息由您发布的jQuery验证库使用链接到:)


I saw here square brackets that are used in class names:

<input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" />

What do these square brackets mean?

解决方案

That is most likely used by some sort of validator or validation library. The class here means that validate this field denoted by validate keyword and then:

required it is required field
custom validation type; allow only letters
length should be between 0 to 100 chars

Well, this information is used by the jQuery validation library you posted the link to :)

这篇关于类名中的方括号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆