You are here

Home

Sign up

') != -1 || name.indexOf(',') != -1 || name.indexOf(';') != -1 || name.indexOf(':') != -1 || name.indexOf('\\') != -1 || name.indexOf('"') != -1 || name.indexOf('[') != -1 || name.indexOf(']') != -1 || name.indexOf(' ') != -1) return false;
if (domain.indexOf('(') != -1 || domain.indexOf(')') != -1 || domain.indexOf('<') != -1 || domain.indexOf('>') != -1 || domain.indexOf(',') != -1 || domain.indexOf(';') != -1 || domain.indexOf(':') != -1 || domain.indexOf('\\') != -1 || domain.indexOf('"') != -1 || domain.indexOf('[') != -1 || domain.indexOf(']') != -1 || domain.indexOf(' ') != -1) return false;
return true;
}

function trimWhitespace(string) {
var newString = '';
var substring = '';
beginningFound = false;

// copy characters over to a new string
// retain whitespace characters if they are between other characters
for (var i = 0; i < string.length; i++) {

// copy non-whitespace characters
if (string.charAt(i) != ' ' && string.charCodeAt(i) != 9) {

// if the temporary string contains some whitespace characters, copy them first
if (substring != '') {
newString += substring;
substring = '';
}
newString += string.charAt(i);
if (beginningFound == false) beginningFound = true;
}

// hold whitespace characters in a temporary string if they follow a non-whitespace character
else if (beginningFound == true) substring += string.charAt(i);
}
return newString;
}

function checkFields() {
var errstr = "";

if (trimWhitespace(document.inputform.firstname.value).length == 0) {
errstr += "- First Name\r\n";
}
if (trimWhitespace(document.inputform.lastname.value).length == 0) {
errstr += "- Last Name\r\n";
}
if (!isValidEmail(document.inputform.email.value)) {
errstr += "- Valid email address\r\n";
}

if (errstr.length == 0) {
document.inputform.submit();
return true;
} else {
alert("Please enter information in the following fields:\r\n" + errstr);
return false;
}
}
// -->

You asked for more from Charleston Home, and our free weekly newsletter has you covered. We’ll keep you informed on design trends, local gardening info, easy DIY projects, news from the editor, and so much more! Stay in the loop about our contests and giveaways, money-savers and boutique sales, even family-friendly recipes. We’ll keep you up to date on everything you need for house and home.

First Name

Last Name

Email Address

Recent Comments
TWEETS