Copy the value from #input1 to #input2 and write it to the database

Everything’s perfect, just add

$w('#input2').focus();

after

$w('#input2').value = input1Value;