<input type="text" name="vtb2" id="vtb2" size="4" maxlength="3" value="640" oninput="fn(this)">
<input type="text" name="vtb3" id="vtb3" size="4" maxlength="3" value="540" readonly="true">
<script>
function fn(a){
input=document.getElementById('vtb3');
var b = parseInt(a.value);
if(!isNaN(b)){
input.value=parseInt(b)-100;
}
}
</script>