基本现场验证

编程入门 行业动态 更新时间:2024-10-08 22:12:57
本文介绍了基本现场验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨ppl, 建议使用哪些字段验证来验证用户输入? 我知道问题很广泛...正在寻找开始清单.诸如sql注入,删除有趣的字符(不是人)之类的东西... 我了解基本检查,只是想知道是否有一个不错的清单可供您注意. 谢谢 Ash

Hi ppl, What are the recommended field validations for validating user input? I know the question is broad... Looking for a starting list. Things like, sql injection, removing funny characters (not people) etc... I understand the basic checks just want to know if there is a good list out there of things to watch out for. Thanks Ash

推荐答案

您可以向UI控件添加一些基本的验证方法. ValueMissing-如果必需元素为空,则返回true. TypeMismatch-此值适用于所有新的类型属性.例如,如果电子邮件值不正确,则此属性返回true. PatternMismatch-当元素包含pattern属性并且不符合正则表达式条件时,此属性将返回true. TooLong-当任何元素超过其maxlength属性时,此属性将返回true. Rangeflow-如果元素的min或max属性高于或低于指定值,则此属性将返回true. StepMismatch-当具有step属性的元素不符合所需的step值时,此属性返回true. 有效-如果上面列出的任何值返回true,则此属性返回false以指示该字段无效.否则,如果满足所有条件 You can add few basic validation methods to your UI control. ValueMissing - returns true if a required element is empty. TypeMismatch - This value applies to all the new type attributes. For example, if an email value is incorrect, this attribute returns true. PatternMismatch - When an element contains the pattern attribute and doesn’t conform to the regular expression conditions, this attribute will return true. TooLong - When any element surpasses its maxlength property this attribute will return true. Rangeflow - If an element’s min or max attributes are above or below the specified values, this attribute will return true. StepMismatch- When an element with the step attribute doesn’t conform to the required step value, this attribute returns true. Valid - If any of the values listed above return true, this attribute returns false to indicate the field is invalid. Otherwise, if all the conditions

更多推荐

基本现场验证

本文发布于:2023-11-12 02:13:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580212.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:现场

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!