hola debería ser algo así:
Código:
if ( ( document.getElementByID('caja1').value ) && (document.getElementByID('caja2').value ) )
{
total = parseInt(document.getElementByID('caja1').value)+parseInt(document.getElementByID('caja2').value);
document.getElementByID('caja3').value = total
}
nota1: los elementos imput deben tener el atributo id.
nota2: hay que usar parseInt si los numeros no llevan decimales sino hay que usar parseFloat.
Espero te sea util.
Saludos