HTML5 let's you have a 'pattern' attribute on form fields to ensure a valid input format.  Think of it as weak client-side validation.