Created
January 17, 2018 01:18
-
-
Save sweetleon/ba4e91b0562f3d690b914713318f1d72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="POST" action="/our/url"> | |
<!-- this should have the current value of version_number --> | |
<input type="hidden" name="version_number" value="1" /> | |
<textarea name="input" onChange="save(event)" /> | |
</form> | |
function save(event) { | |
event.target.form['version_number'].value++; | |
var request = new XMLHttpRequest(); | |
request.open(event.target.form.method, event.target.form.action); | |
request.send(new FormData(event.target.form)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment