禁用asp .net验证控件 [英] Disabling the asp .net validation controls

查看:68
本文介绍了禁用asp .net验证控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,





我有一个注册表,并添加了一些验证控件,如电话号码,电子邮件和一些必填字段验证器。

例如:假设如果我自动写错了电子邮件ID,则会显示电子邮件验证消息,并且电话号码也是相同的,如果我点击取消按钮,最后不是点击提交(记得我写了一些文字)电子邮件和电话字段以及验证消息已启用)。表单/弹出模式已关闭。再次当我打开模式弹出窗口填充字段时,先前的消息启用。



请关闭模式弹出窗口后何时禁用验证消息我打开表格应该也不会显示以前的数据和验证信息。



提前致谢!

解决方案

您可以使用java脚本清除验证文本,如下所示。



 var obj = document.getElementById(RequiredFieldValidator1) ; 
obj.innerHTML =;







包含任何合适的功能并在重置按钮上调用相同的功能。





希望有帮助


查看这些

< a href =http://veskokolev.blogspot.in/2007/11/how-to-disable-validation-group-with.html>如何使用JavaScript禁用验证组? [ ^ ]

如何使用JavaScript启用禁用必填字段验证器 [ ^ ]



ASP.NET验证在深度 [ ^ ]

Rockstar_写道:

大约有40个页面上的验证控件,我是否必须编写所有要访问的控件名称?

使用这些(用于循环目的)

清除表单中所有输入字段的简单方法。 - 服务器端 [ ^ ]

清除表单中所有输入字段的简单方法。 - 客户端 [ ^ ]


您可以在取消按钮aspx页面上使用CausesValidation =false。它将禁用所有验证。

Hi all,


I've a registration form and added some validation controls like phone number,email and some required field validator.
Ex: Suppose if i write wrong email id automatically a email validation message is displaying and the same for phone number also and finally instead of clicking Submit if i click on Cancel button (remember i wrote some text in email and phone fields and validation messages are enabled). The form/Pop Up Modal is closed. Again when i open the modal pop up for filling the fields the previous messages enabled.

Kindly help me how to disable the validation messages after closing the modal pop up and when i open the form should nor show previous data and validation messages.

Thanks in advance!

解决方案

You can use the java script to clear the Validation text as shown below.

var obj = document.getElementById("RequiredFieldValidator1");
obj.innerHTML = "";




Wrap up with any suitable function and call the same on your reset button click.


Hope it helps


Check these
How to disable validation group with JavaScript?[^]
How to Enable Disable Required Field Validator using JavaScript[^]

ASP.NET Validation in Depth[^]

Rockstar_ wrote:

There are around 40 validation controls on the page, do i have to write all those control names to access?

Use these(for looping purpose)
Simple and easy way to clear all the input fields in the form. - Server side[^]
Simple and easy way to clear all the input fields in the form. - Client side[^]


You can use CausesValidation="false" on cancel button aspx page..It will disable all the validation.


这篇关于禁用asp .net验证控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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