
// SuggestALink.js
// Form Validation Function for the Submit a Link Form

function validateForm() {
  // Add http:// if it is not already added!
  var strUrlVal = "";
  var reUrl = /http:\/\//;
  fldUrl    = eval("SubmitALinkForm.URL");
  strUrlVal = fldUrl.value;
  blnUrl    = reUrl.test(strUrlVal);
  if (blnUrl == false) { fldUrl.value = "http://" + strUrlVal; }
	
  // Make sure the number of characters for the description is limited.
  var numDescVal = 0;
  fldDesc    = eval("SubmitALinkForm.Description");
  strDescVal = fldDesc.value;
  if (strDescVal.length > 195) { 
     alert("Link descriptions are limited to 195 characters. Please revise.");
     return false;
  }
  else {
     return true;
  }
}

