function inputError(input, value) {
  input.style.border = "2px dotted red";
  const errorLabel = input.previousElementSibling;
  errorLabel.style.color = "red";
  // switch statement to determine which error message should be displayed
  switch (value) {
    case 0:
      errorLabel.textContent =
        "Please enter only alphabetic characters, spaces, or hyphens:";
      break;
    case 1:
      errorLabel.textContent = "Please enter a valid email address:";
      break;
    case 2:
      errorLabel.textContent = "Please enter a minimum of 3 characters:";
      break;
    case 3:
      errorLabel.textContent = "Please enter a maximum of 30 characters:";
      break;
    default:
      break;
  }
}
// function to change the styling of text inputs (the label and input elements) if erroneous data has been entered
function to change the styling of text inputs (the label and input elements) if erroneous data has been entered
function to change the styling of text inputs ( the label and input elements ) if erroneous data has been entered
function inputError(input, value) {
  input.style.border = "2px dotted red";
  const errorLabel = input.previousElementSibling;
  errorLabel.style.color = "red";
  switch (value) {
    case 0:
      errorLabel.textContent =
        "Please enter only alphabetic characters, spaces, or hyphens:";
      break;
    case 1:
      errorLabel.textContent = "Please enter a valid email address:";
      break;
    case 2:
      errorLabel.textContent = "Please enter a minimum of 3 characters:";
      break;
    case 3:
      errorLabel.textContent = "Please enter a maximum of 30 characters:";
      break;
    default:
      break;
  }
}
function inputError ( input , value ) { input . style . border = "2px dotted red" ; const errorLabel = input . previousElementSibling ; errorLabel . style . color = "red" ; switch ( value ) { case 0 : errorLabel . textContent = "Please enter only alphabetic characters, spaces, or hyphens:" ; break ; case 1 : errorLabel . textContent = "Please enter a valid email address:" ; break ; case 2 : errorLabel . textContent = "Please enter a minimum of 3 characters:" ; break ; case 3 : errorLabel . textContent = "Please enter a maximum of 30 characters:" ; break ; default : break ; } }
function to change the styling of text inputs (the label and input elements) if erroneous data has been entered
function to change the styling of text inputs ( the label and input elements ) if erroneous data has been entered
// switch statement to determine which error message should be displayed