i have a simple question.
how can i check if the username or email they entered is already exist..
i have this code,
if(document.RegForm.user.value =="")
{
alert("User Name Please?");
valid=false;
}
that’s my code for username, i don’t know what code i will add to check if user name is already exist.. 🙁
hmm.. also this is for the email:
var emailExp= /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
strEmail=document.RegForm.eadd.value;
if(strEmail.search(emailExp)==-1)
{
alert("A Valid Email Address Required");
valid=false;
}
what code will i add? to check if email is already exist. help me please .. 🙁
thank you so much guys..
You will need ajax to check if a username has been taken.
Ajax is sending and receiving data without refreshing the page.
here is a simple tutorial: http://www.w3schools.com/Ajax/ajax_example.asp
I suggest you use a javascript library like jQuery to make everything easier.