JSFiddle - React, Tailwind, and code Playground

by Rayon Dabre

HTML

<form id="testform" name="entform" onsubmit="return promptChar()" method="post">
  <input id="input-text" name="entchar" type="text" placeholder="Enter Text">
  <input type="submit" value="Send">
</form>

JavaScript

function promptChar() {
  var field = document.getElementById('input-text').value;
  if (field == "a") {
    alert('hey');
    return false
  }
}