Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <form action="/some-api/" method="POST" onsubmit="disableButton()">
  2. <button id="btn" type="submit">Post</button>
  3. </form>
  4.  
  5. <script>
  6. function disableButton() {
  7. var btn = document.getElementById('btn');
  8. btn.disabled = true;
  9. btn.innerText = 'Posting...';
  10. }
  11. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement