The way I do it is to just send the email via ajax to a validation
script that returns back an xml response.

$("#signup-form #email").blur(function() {
  $.get("/ajax/emailcheck", { email: $("#email").val() },
  function (xml) {
    if ($('status',xml).text() == 1) {
      // Available and valid
      $("#email").css("border","1px solid green");
    }
    else {
      $("#email").css("border","2px solid red").focus();
    }
    $("#email-note").html($("html",xml).text());
  },"xml");
  return false;
});

This is what the following would send and the response they would get

http://www.murmp.com/ajax/emailcheck?email=invalid
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>0</status>
<html>Not a valid email address</html>
</response>

http://www.murmp.com/ajax/emailcheck?email=va...@email.com
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>1</status>
<html>Email available</html>
</response>

http://www.murmp.com/ajax/emailcheck?email=jsu...@murmp.com
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>0</status>
<html>Email already in use</html>
</response>

On the backend, I use a free/open-source validation class.  I'm sure
that there are similar projects for .net
http://code.google.com/p/php-email-address-validation

You can see this in action at (shameless plug)
http://www.murmp.com/signup

Hope that helps!
-Jonathon

On May 22, 5:06 am, gladrinkz <gladri...@gmail.com> wrote:
> is ant one know how can i set email validation in jquery i am
> using .net

Reply via email to