made JS function to clear and update form, need to apply to more forms