验证.. [英] Validation..

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

问题描述

大家好...

如果文本框中的电子邮件ID无效,我想知道如何停止button_click事件.
我正在使用正则表达式验证器,但它仅显示无效的emailid,但正在单击按钮,并且无效的电子邮件存储在数据库中.

请给我帮助...

谢谢
Nikhil

Hi all ...

I want to know how to stop the button_click event if the email id in textbox is given invalid.
i am using regular expression validator but it is only showing that invalid emailid but button click is happening and that invalid email is storing in database.

Please send me the help...

Thanks
Nikhil

推荐答案

可能您必须检查按钮控件的有效性onClientClick.这在服务器端事件之前执行.但是,当您检查验证时,需要通过正确设置return false 来确保执行已停止.

类似的东西:

Probably you must be checking the validation onClientClick of button control. This executes before server side event. But when you check the validation, you need to make sure the execution is stopped by setting return false properly.

something like:

onClientClick = if(InValid(someEmail)) return false;


function InValid(checkEmail)
{
 // use your logic here and return true or false accordingly. 
}


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

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