Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hi,

I am having below javascript function-

function validateEmail(email)
{ 
var regx = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/igm;
if (reg.test(email)) {
return true; }
else {
return false;
}
}

I am using this function for validating an email.

I have below MVC view code-

 @Html.TextBoxFor(model => model.CustomField, new { maxlength = "51", @id = "TextBox1", onblur = ???? })

How i call this function into @Html.TextBoxFor, where it will allow to accept my input value?

Please suggest.
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900