Add JS for toggling edit fields. #1684