added javascript to interact with DOM to update text fields