Adds function that updates textboxes dynamically