code field validation