如何验证多个文本框? [英] How to Validate multiple textboxes?

查看:94
本文介绍了如何验证多个文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,



我有一个网页表单,它基本上是一个数据输入网页,页面上有50多个带文本框和下拉菜单的控件等。 />
所以说我有10个文本框只能接受字母

30只接受数字的文本框

10应该接受字母数字的文本框。

这些都不应该接受特殊字符。不为每个人编写正则表达式。有没有更好的想法,比如在文本框中输入数据,那么它应该验证说只接受字母/数字等。或者请告诉我如何实现这一点的一些亮点。

Hello Experts,

I have a web form and its basically a data entry web page where the page has 50+ controls with Textboxes and dropdown etc.
So Say I have 10 textboxes that should accept only Alphabet
30 Textboxes that should accept only Numbers
10 Textboxes that should accept alphanumeric.
None of these should accept Special characters. Without writing Regular expression for each of these. Is there any better idea like while entering the data in textbox, then and there it should validate saying accepts only Alphabet/Numeric etc. Or else Please show me some light for how to do to achieve this.

推荐答案

这个代码项目提示可能会让您感兴趣:将单个验证器用于多个控件 [ ^ ]。
THis Code Project tip could interest you: "Using Single Validator for Multiple Controls"[^].


这篇关于如何验证多个文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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