文本输入中的最小最大数量 - Jquery/javascript

2022-01-24 00:00:00 input numbers range jquery javascript

我想设置允许在文本输入中输入的最小和最大数字我知道我可以使用范围输入来做到这一点,但在不兼容的浏览器中使用时它仍然具有最大值和最小值吗?

I would like to set a minimum and maximum allowed number to be entered in text input I know I can do this with range input but will it still have the max and min when used in non compatible browsers?

如果不能,请您指出正确的方向,谢谢阅读.

if not could you please point me in the right direction, thanks for reading.

推荐答案

使用 jquery 验证器插件.它有一组很好的特性,也有最小最大验证.但是在服务器端检查值也是必须的.这里 是 min 和 最大.

Use jquery validator plugin. It has a nice set of features, and min max validation too. But checking values on server side is a must too. Here is an examples for min and max.

相关文章