Advertisement
|
[x]
Attachment Details
|
||
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: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: |
function checkEmail (strng) {
var email = document.create_account.email.value;
var error = "";
if (strng == "") {
error = "You didn't enter an email address.\n";
}
var emailFilter=/^.+@.+\..{2,3}$/;
if (!(emailFilter.test(strng))) {
error = "Please enter a valid email address.\n";
} else {
//test email for illegal characters
var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/
if (strng.match(illegalChars)) {
error = "The email address contains illegal characters.\n";
}
}
inlineMsg('email',error,3);
return false;
}
// phone number - strip out delimiters and check for 10 digits
function checkPhone (strng) {
var phonenum = document.create_account.phone.value;
var error = "";
if (strng == "") {
error = "You didn't enter a phone number.\n";
}
var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
if (isNaN(parseInt(stripped))) {
error = "The phone number contains illegal characters.";
}
if (!(stripped.length == 10)) {
error = "The phone number is the wrong length. Make sure you included an area code.\n";
}
inlineMsg('phonenum',error,3);
return false;
}
// password - between 6-8 chars, lowercase, and numeral
function checkPassword (strng) {
var pass = document.create_account.password.value;
var error = "";
if (strng == "") {
error = "You didn't enter a password.\n";
}
var illegalChars = /[\W_]/; // allow only letters and numbers
if (strng.length <= 6) {
error = "The password must contain at least 6 characters.\n";
}
else if (illegalChars.test(strng)) {
error = "The password contains illegal characters.\n";
}
inlineMsg('pass',error,3);
return false;
}
//function samePassword (strng) {
//var passw2 = document.create_account.pass2.value;
// if (strng != document.create_account.password.value) {
// error = "The password does not match.\n";
// }
//inlineMsg('passw2',error,3);
//return false;
//}
var MSGTIMER = 20;
var MSGSPEED = 5;
var MSGOFFSET = 3;
var MSGHIDE = 3;
// build out the divs, set attributes and call the fade function //
function inlineMsg(target,string,autohide) {
var msg;
var msgcontent;
if(!document.getElementById('msg')) {
msg = document.createElement('div');
msg.id = 'msg';
msgcontent = document.createElement('div');
msgcontent.id = 'msgcontent';
document.body.appendChild(msg);
msg.appendChild(msgcontent);
msg.style.filter = 'alpha(opacity=0)';
msg.style.opacity = 0;
msg.alpha = 0;
} else {
msg = document.getElementById('msg');
msgcontent = document.getElementById('msgcontent');
}
msgcontent.innerHTML = string;
msg.style.display = 'block';
var msgheight = msg.offsetHeight;
var targetdiv = document.getElementById(target);
targetdiv.select();
var targetheight = targetdiv.offsetHeight;
var targetwidth = targetdiv.offsetWidth;
var topposition = topPosition(targetdiv) - ((msgheight - targetheight) / 2);
var leftposition = leftPosition(targetdiv) + targetwidth + MSGOFFSET;
msg.style.top = topposition + 'px';
msg.style.left = leftposition + 'px';
clearInterval(msg.timer);
msg.timer = setInterval("fadeMsg(1)", MSGTIMER);
if(!autohide) {
autohide = MSGHIDE;
}
window.setTimeout("hideMsg()", (autohide * 1000));
}
// hide the form alert //
function hideMsg(msg) {
var msg = document.getElementById('msg');
if(!msg.timer) {
msg.timer = setInterval("fadeMsg(0)", MSGTIMER);
}
}
// face the message box //
function fadeMsg(flag) {
if(flag == null) {
flag = 1;
}
var msg = document.getElementById('msg');
var value;
if(flag == 1) {
value = msg.alpha + MSGSPEED;
} else {
value = msg.alpha - MSGSPEED;
}
msg.alpha = value;
msg.style.opacity = (value / 100);
msg.style.filter = 'alpha(opacity=' + value + ')';
if(value >= 99) {
clearInterval(msg.timer);
msg.timer = null;
} else if(value <= 1) {
msg.style.display = "none";
clearInterval(msg.timer);
}
}
// calculate the position of the element in relation to the left of the browser //
function leftPosition(target) {
var left = 0;
if(target.offsetParent) {
while(1) {
left += target.offsetLeft;
if(!target.offsetParent) {
break;
}
target = target.offsetParent;
}
} else if(target.x) {
left += target.x;
}
return left;
}
// calculate the position of the element in relation to the top of the browser window //
function topPosition(target) {
var top = 0;
if(target.offsetParent) {
while(1) {
top += target.offsetTop;
if(!target.offsetParent) {
break;
}
target = target.offsetParent;
}
} else if(target.y) {
top += target.y;
}
return top;
}
// preload the arrow //
if(document.images) {
// arrow = new Image(7,80);
arrow.src = "../image/misc_list_type_style.png";
}
<form name="create_account">
<ul>
<li class="account_info_label">
<div class="account_info_personal">Email Address: <input id="email" name="email" value="" type="text" onchange="checkEmail(this);this.blur();this.focus()" /></div>
<div class="account_info_privacy"><a href="index.php?module=privacy" target="_blank">Privacy Policy</a></div>
</li>
<br clear="all" />
<li class="account_info_label">
<div class="account_info_personal">Choose Password: <input id="password" name="password" value="" type="password" onchange="checkPassword(this);this.blur();this.focus()" /></div>
<div class="account_info_personal_right">Re-Enter Password: <input id="password2" name="password2" value="" type="password" onchange="samePassword(this);this.blur();this.focus()" /></div>
<br clear="all" />
<span class="account_info_optional">Password must be at least 6 characters.</span>
</li>
<br clear="all" />
<li class="account_info_label">
<div class="account_info_personal">Phone Number: <input id="phone" name="phone" value="" type="text" onchange="checkPhone(this);this.blur();this.focus()" /></div>
<div class="account_info_personal_right">Fax Number: <span class="account_info_optional">(optional)</span> <input id="fax" name="fax" value="" type="text" /></div>
</li>
</ul>
</form>
|
|
[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! |
||
|
Loading Advertisement... |