Wednesday, March 16, 2011

JavaScript return Value to Label or TextBox

Here Example of Email Validation is given

function Email(obj1)
{
var email=obj1.value;
//alert(email);
var reguex=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
if(reguex.test(email))
{
return true;
}
else
{      

document.getElementById("lblemail").innerHTML="email not valid";

return false;
}
}



ASPdotNET-Example