问题标签 [validation-controls]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
860 浏览

c# - 如何动态使用验证?

我正在使用下面的 .aspx 代码来验证textbox..这工作得很好

我想要在这上面textbox有什么dropdownlist named batchname,如果批处理名称的长度是 2,我想验证出勤率应该是什至没有。

我在按钮单击时使用了以下代码

我想在客户端做。我怎样才能在 C# 中做到这一点?

0 投票
1 回答
864 浏览

asp.net - 如何显示自定义验证器错误消息的消息框?

在我的用户控件中,我的代码如下:

在后面的代码中,我有一个功能:

我想在消息框中收到错误消息“请添加规则以获取符合条件的成员”。

任何人请帮忙。

0 投票
1 回答
1864 浏览

asp.net - 悬停时不显示工具提示

一段简单的代码。我注意到,当我将鼠标悬停在“*”上时,工具提示不会显示。

工具提示是否在 Internet Explorer 10 中工作?

代码:

问候,

0 投票
3 回答
9371 浏览

asp.net - 范围验证器在 asp.net 最小值和最大值中不起作用

我已经申请RangeValidatorTextBox。但它总是向我显示错误:无效范围,尽管我给出了最小值 10 和最大值 25。我希望用户不能输入长度小于 10 且大于 25 的值。我希望用户可以输入任何内容,所以我type="string"RangeValidator. 但它总是给我错误信息:无效范围。

0 投票
2 回答
3668 浏览

asp.net - 验证阿联酋数字的正则表达式

我需要验证阿联酋手机号码的正则表达式

+9710501234566 或

+971 (050) (123 4566)

目前我正在使用

请问你能帮帮我吗?我不太擅长正则表达式...

0 投票
1 回答
207 浏览

c# - Using Arrays and Validation Controls in C# ASP.NET

The part of this assignment that I'm stuck on is this: The user must enter a state abbreviation in the "State" field (which is a standard textbox). However, I'm supposed to make sure that the the characters entered in the textbox are a valid state abbreviation. So I create an array of all 50 states, and then used a custom validator to accept the user input and compare it to all 50 state abbreviations using a for loop. However, I'm getting an error that says I haven't created a definition for an event (stateArrayCheck) even though I know I have! I have a lot more work to do on this project, so this is really frustrating being stuck on this part of the assignment. Here's my code:

I know you may not be a huge fan of validators. My teacher isn't either, but they're required for this assignment. Any help would be GREATLY appreciated. Thank you.

0 投票
0 回答
23 浏览

asp.net - 在单个控件上使用多个验证控件

这两个验证控件中只有一个有效,但不能同时工作。

0 投票
1 回答
1178 浏览

c# - 在 MVC 5 中使用 ModelClientValidationRule 会引发错误?

我尝试在 MVC 5 项目中进行自定义客户端验证。当我添加以下代码时:

我收到以下错误:

找不到类型名称“ModelClientValidationRule”。此类型已转发到程序集“System.Web.WebPages,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”。考虑添加对该程序集的引用。

但是当我检查web.config文件时,我使用的是从 0.0 开始支持的 WebPages 版本

0 投票
2 回答
1059 浏览

asp.net - 将潜在危险字符串列入黑名单的正则表达式

应该使用什么正则表达式将在 ASP.Net 中导致以下错误的字符序列列入黑名单 - “从客户端检测到潜在危险的 Request.Form 值”。(例如 <br>、<hi>、<a> 等。)

我需要使用asp.net 正则表达式验证控件将那些会导致此错误的字符序列列入黑名单。

例如,如果我输入 123< hi > 、有效的 < abc > 等。我需要验证失败。

PS:我已将 <br> 隔开,因为它没有在问题中正确显示,但实际上它应该没有 < 或 > 之间的空格以及它们之间的字符串

0 投票
1 回答
818 浏览

asp.net - 正则表达式验证日期格式 MM/DD/YY,包括闰年

我也在寻找一个正则表达式来验证日期格式 mm/dd/yy(包括闰年)。日期应以 MM/DD/YY 格式屏蔽。请帮我找到解决方案。提前非常感谢!