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

Popular Categories

Personal email validation script.

+1 vote
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");





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

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

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



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 949 views
+2 votes
1 answer 282 views
+3 votes
1 answer 98 views
+6 votes
1 answer 2,899 views
+5 votes
1 answer 1,240 views
+2 votes
1 answer 176 views
+6 votes
3 answers 7,420 views
+4 votes
5 answers 4,237 views

Not a Member yet?

Ask to Folks Login

My Account
314 Folks are online
0 members and 314 guest online
Your feedback is highly appreciated