我该如何编写验证 [英] how can i write validations
本文介绍了我该如何编写验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用smpt电子邮件表格
用户单击提交时,应检查验证并发送代码
请帮我怎么办?
这是我完成的代码,但我需要验证...
例子
Hi all,
I am working with smpt email form
when the user clicks on submit it should check the validation and send the code
Please help me how can i do it ?
This is the code with i done but i need validations...
example
protected void Btn_Submit_Click(object sender, EventArgs e)
if{validation == true}
{
SendUserMail("mailid",txt_mail.text,"Hi How are you");
string Body = "fname.text", "name.text", "mail.text";
SendUserMail("mail", body);
}
else
{
messge box = please enter the fld
}
请告诉我如何编写验证以及如何执行验证?
请为我提供操作方法
我还需要验证码,所有txt flds plz
例如:如果用户单击提交,则必须查看是否已提交所有txt框.
Please tell me how can i write validation and how can i do this??
kindly provide me how to do it
i need validation code also all txt flds plz
example: if user clicks on submit it has to see all the txt boxes are filed or not
推荐答案
使用此javascript验证电子邮件地址
use this javascript to validate email address
function validateEmail(elementValue){
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}
/; 返回 emailPattern.test(elementValue); }
/; return emailPattern.test(elementValue); }
这篇关于我该如何编写验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文