JSFiddle - React, Tailwind, and code Playground

HTML

<form method="post" action="">
    <input type="text" name="submit1" id="submit1" />
    <input type="text" name="noSubmit1" id="noSubmit1" />
    <input type="text" name="submit2" id="submit2" />
    <input type="submit" />
</form>

JavaScript

$('#noSubmit1').keypress(function(event) {
    if(false){
        event.preventDefault();
    }
});