<form action="">
    <input pattern="[A-Z]+">
    <button type="submit">submit</button>
</form>
<style>
  input:invalid { background-color: red; }
</style>