JSFiddle - React, Tailwind, and code Playground

HTML

<form action="/test" method="post">
    <input type="text" name="somefield"/>
    <button type="submit">Send</button>
</form>

JavaScript

$("form").submit(function () {
    $(':submit', this).prop("disabled", true).html("Wait here while posted...");
});