Named function to check the length of a field