Hey there! any question in your mind? Ask It Now!.

Popular Categories





Personal email validation script.

+1 vote
126 views
asked in Programming by amit_pammu Expert (5,030 points)
i need a personal email validation script . that means , gmail,hotmail,yahoo,rediff, not allowed.

1 Answer

0 votes
answered by Himanshu Expert (5,940 points)

Firstly  I would say you should elaborate your question more so that any one can give you the correct solution which you want. Any way as I understood you need a validation script that can validate your these words gmail,hotmail,yahoo,rediff.

 

See this script you can get idea how you can make validation:

 

<script type="text/javascript">

function validate()

{

var cars = ["hotmail.com", "yahoo.com", "rediff.com"];

var x = document.getElementById("txt").value

var res = x.split("@");

 

if (cars.indexOf(res[1]) > -1) {

 alert("Word found in string");

} else {

   alert("Word not found");

}


 

}

</script>

<form action="" method="post" onsubmit="return validate()">

<input type="text" id="txt" name="txt">

<input type="submit" value="submit">

</form>

 

Now if user is using any id with @yahoo.com or @hotmail.com etc user will get alert.

Modify the script as per your need.


 

Related Questions

+1 vote
1 answer 75 views
+1 vote
1 answer 734 views
+2 votes
1 answer 134 views
+3 votes
1 answer 33 views
+6 votes
1 answer 1,628 views
+5 votes
1 answer 1,167 views
+2 votes
1 answer 136 views
+6 votes
3 answers 6,828 views
0 votes
0 answers 135 views

Not a Member yet?

Ask to Folks Login

My Account
1068 Folks are online
66 members and 1002 guest online
Your feedback is highly appreciated