JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<form id="form_year" action="/" method="post">
<input type="hidden" name="year" value="2015">
<input type="hidden" name="nmbr" value="22">
<input type="hidden" name="code" value="5Tvfr5T">
<div class="button-small"><input type="submit" name="" value="Submit"></div>
</form>
</div>
JavaScript
$(document).ready(function(){
var posted = false;
$('#form_year').submit(function(){
if (!posted) {
var data = $(this).serialize();
$.post('process_year_data.php', data, function(data){
$("#form_year").fadeOut(500).hide(function(){
$("#container").fadeIn(500).show(function(){
$("#container").html(data);
});
});
});
posted = true;
return false;
}
});
});