Предполагая такую структуру:
<input id="inputfield1" type="text" />
<input id="inputfield2" type="text" />
, вы можете использовать этот код:
$("#inputfield1").keyup(function() { // when key is released in "#inputfield1"
// "change()" is also possible instead of "keyup()", slightly different behavior
var input_value = parseFloat($("#inputfield1").val()); // get number as float
// alternately parseInt(string, 10), in case you work with integers
if (!isNaN(input_value)) { // the input is a number
$("#inputfield2").val(input_value * 2); // update second field
} else { // the input wasn't a number
$("#inputfield2").val("not a number?"); // show an error mesage
}
});