I had created an registration form in which i had created and email i had provided validation to all the filed but I'm confused how to give validation to email field because i want that email should be either gmail.com or yahoomail.com if some one enters any other email even yahoomail.co.in it should give error message. here is the code i which checking that its having @ and . in the email or not
var atdrate=email.indexOf("@");
var dot1=email.indexOf(".");
else if(atdrate<1 || dot1<1)
    {
        alert("Enter valid Email");
        if(gml<atdrate+1)
            alert("Enter  a vaild mail id");
        else if(yml<atdrate+1)
            alert("Enter a valid email id");
    }
 
     
    