The most simple way to do this is using jquery
function myfunction()
{
var val = document.getElementById("demo").value;
$.post( "test.php", { value: val})
.done(function( data ) {
alert( "Value submited");
});
}
Call myfunction() on blur event. like this
<input id="demo" type="text" value="1" onblue="myfunction()">
This will send your value to test.php page and you can do the rest. If you want to avoid jquery then do it with simple AJAX with javascript directly.