Fixed js issue when form had errors.