Solved bug on javascript updateForm