function validateInput() {
  var errTxt;

  errTxt = "";
  if (document.frmInput.usr_name.value == "")
    errTxt += "Name";
  if (document.frmInput.usr_email.value == "") {
    if (errTxt != "")
      errTxt += ", ";
    errTxt += "Email";
  }
  if (document.frmInput.usr_msg.value == "") {
    if (errTxt != "")
      errTxt += ", ";
    errTxt += "Message";
  }

  if (errTxt != "") {
    alert("Please fill the following fields: " + errTxt);
    return false;
  }

  // check email format
  if (!checkEmail(document.frmInput.usr_email.value, false)) {
    alert("The email address '" + document.frmInput.usr_email.value + "' isn't valid");
    return false;
  }

  return true;
}

