Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Form.io 问题在这里。
有没有人研究过如何对复选框字段应用计数检查。
我希望用户最多只能选择 3 个字段。
非常感谢
对于任何想要这样做的人,它适用于以下代码:
valid = countIn(Object.values(input)); function countIn(array){ var count = 0; for(var i = 0; i < array.length; ++i){ if(array[i] == true) count++; }; if (count <= 3){ return true } else{ return false } } }