Added JS validation to edit