Advertisement
Advertisement
| 10.08.2008 at 01:58PM PDT, ID: 23799137 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: |
function checkForValidEmailAddress(emailAddressField)
{
var emailAddress = emailAddressField.value;
// Do not throw an error if the field is blank.
if ("" == emailAddress)
{
return true;
}
var at = "@";
var dot = ".";
var positionOfAtSymbol = emailAddress.indexOf(at);
var lengthOfAddress = emailAddress.length;
// Check to see if an "@" character exists.
// If it does exist, it should not be as
// the first or last character of the address.
if (emailAddress.indexOf(at) == -1
|| emailAddress.indexOf(at) == 0
|| emailAddress.indexOf(at) == lengthOfAddress - 1)
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
// Check to see if an "." character exists.
// If it does exist, it should not exist as
// the first or last character of the address.
if (emailAddress.indexOf(dot) == -1
|| emailAddress.indexOf(dot) == 0
|| emailAddress.indexOf(dot) == lengthOfAddress - 1 )
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
// Make sure that there is a second "." character.
if (emailAddress.indexOf(at,(positionOfAtSymbol + 1)) != -1)
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
// Make sure that a "." character does not immediately
// preceed or follow the "@" character.
if (emailAddress.substring(positionOfAtSymbol - 1, positionOfAtSymbol) == dot
|| emailAddress.substring(positionOfAtSymbol + 1, positionOfAtSymbol + 2) == dot)
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
// Make sure there exists at least one "."
// character after the "@" character.
if (emailAddress.indexOf(dot,(positionOfAtSymbol + 2)) == -1)
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
// Make sure there is no whitespace within the address.
if (emailAddress.indexOf(" ") != -1)
{
emailAddressField.select();
emailAddressField.focus();
return false;
}
return true;
}
<script language = "Javascript">
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail ID")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}
return true
}
function ValidateForm(){
var emailID=document.frmSample.txtEmail
if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email ID")
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
|