问题标签 [comparevalidator]

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 投票
1 回答
1240 浏览

asp.net - asp CompareValidator 不接受有效日期

具有运算符数据类型检查和数据类型作为日期的 ASP CompareValidator 不接受以下日期:2013 年 3 月 29 日和 2012 年 3 月 30 日。这是一个已知的错误?下面是验证。

0 投票
1 回答
3530 浏览

asp.net - 使用 ASP:CompareValidator 将 ASP:DropDownList 与文字值进行比较

我们正在实现一个 ASP:CompareValidator,但它没有像我们预期的那样工作。

在表单上有一个 ASP:DropDownList,其中 DropDown 中的一项是:

该文本还包括角括号。

我们要确保用户从 DropDown 中选择了某些内容,因此我们不希望在 DropDown 显示时保存数据:

您能否检查我的标记并告诉我为什么当用户单击更新按钮时会显示验证错误消息?

DropDown 的值来自此数据源:

0 投票
1 回答
441 浏览

c# - 每次controltocompare的值改变时触发comparevalidator

我的日历扩展器有一个比较验证器。每当用户选中/取消选中 gridview 中的框时,设置为 controltocompare 的文本框都会更改值。每次触发checkedchanged事件时,如何从后面的代码中触发comparevalidator?

0 投票
2 回答
1221 浏览

c# - CompareValidator 日期和时间

我正在使用以下代码来确保我的文本框输入了有效日期:

但是当我输入带有时间验证的日期时失败。有没有办法让这种类型的验证器也接受带有时间的日期,或者我是否必须为此构建一个自定义验证器?如果我必须走自定义验证路线,你会建议什么?

0 投票
1 回答
262 浏览

c# - CompareValidator 可见性


我在 C# 上遇到了 compareValidator 的问题。
我在验证密码时会显示 2 个错误:
- 新密码和密码不能相同,或者
- 新密码字段必须相同

我使用了两个比较验证器。一个验证当前密码和新密码字段(仅限第一个)。和其他检查新密码字段是否等于确认新密码字段。
所以,问题是当我输入与新密码字段相同的当前密码字段并且我输入与新密码字段不同的确认新密码字段时,因为两个错误都出现了。我需要一次显示一个错误...

有没有办法只用 compareValidator 来解决这个问题?有没有办法获得 comparevalidator 生成的“可见性”?

提前致谢。

0 投票
3 回答
1775 浏览

c# - how to Clear textBox after CompareValidator caught wrong datatype?

and I am a beginner in using asp.net and C# in visual studio 2008

I have a TextBox with the ID = LimitAmount, it is supposed to accepts input of type DOUBLE, therefore I made a CompareValidator (CompareValidatorAmount) to control this, now I want to get the TextBox Cleared after an invalid input type.

thank you !

0 投票
1 回答
472 浏览

asp.net - 我可以在 CompareValidator 中将 Gridview BoundFields 用作 ControlToValidate 和 ControlToCompare 吗?

我有一个带有两个 BoundFields 的网格视图,用于 DATE_RANGE_FROM 和 DATE_RANGE_TO。我想使用 CompareValidator 来确保 DATE_RANGE_TO 在用户编辑它们时不会包含早于 DATE_RANGE_FROM 的日期。我可以使用gridview boundfields作为controltovalidate和controltocompare吗?

0 投票
2 回答
2602 浏览

c# - ASP.NET:如果其他字段不为空,则跳过运行 CompareValidator

我的搜索表单有 2 个字段:日期和对象 ID。我正在使用这样的日期验证:

ValueToCompare 是从代码隐藏设置的(从现在起 10 天后)。

我不想运行日期验证,当对象 id 字段不为空时(允许在没有日期限制的情况下进行搜索)。不使用 CustomValidator 的解决方案是什么?

0 投票
2 回答
3079 浏览

asp.net - asp.net“比较验证器”验证

我正在尝试使用比较验证器验证 asp.net 中的文本框fromdate和文本框,我的脚本是:todate

这工作正常!但我只有在单击按钮时才会收到消息框。但是我想在我Todate在日历控件中单击日期的那一刻得到消息框,并且文本框必须清楚。请帮帮我。

0 投票
4 回答
10015 浏览

c# - CompareValidator 验证两个日期

大家好,我的日期格式采用以下格式dd-MMM-yy我正在使用比较验证器来验证日期,如下所示

但这不能按要求工作,所以有人可以帮助我如何验证所需格式的日期