I have a field that allows users to search for a store based on either a suburb or a post code. I am using the Jquery validate plugin to validate the value entered in this field. Basically, I want to set the maxlength to 4 ONLY if a number is entered. If a suburb is entered there there doesn't need to be a max length.
Any suggestions for the best approach?