JSFiddle - React, Tailwind, and code Playground

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(){
 
 function promptChar(){

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

})();