I have 2 text fields (ar_date1 + ar_date2) which the user has to enter some #s in. Then I would like a 3rd text field (ar_date_total) to be autocalculated and populated based on the users' input. I do not want the user to press any button for this to occur, but automatically populate when the user hit tab or move to the next field.
I am fairly new to using Javascript to calculate values. So far, I have the following code ... this does not work now.
<SCRIPT LANGUAGE="JavaScript">
function Calculate(){
var vAirRail1 = parseInt(document.all.ar_date1.value);
var vAirRail2 = parseInt(document.all.ar_date2.value);
var vAirRailTotal = AirRail1 + vAirRail2
document.all.ar_total.value = vAirRailTotal;
}
</SCRIPT>
Thank you!
I am fairly new to using Javascript to calculate values. So far, I have the following code ... this does not work now.
<SCRIPT LANGUAGE="JavaScript">
function Calculate(){
var vAirRail1 = parseInt(document.all.ar_date1.value);
var vAirRail2 = parseInt(document.all.ar_date2.value);
var vAirRailTotal = AirRail1 + vAirRail2
document.all.ar_total.value = vAirRailTotal;
}
</SCRIPT>
Thank you!