Update code input box when using back- or forward-button