Formats an input field as you type.