Images from GUI Bloopers, by Jeff Johnson. Used without permission.
What's wrong with these?
Text fields should be used only for data that really is unstructured, free-form text. Examples of such text are names of people, user-defined passwords, comments, and transaction reasons. Examples of textlike data that is not completely free-form are telephone numbers, social security numbers, dates, state, city, font family, and zip codes.
Alternatives to text fields
Text field specialized for a particular type of input. Bank automatic teller machines (ATMs) in the US require users to specify dollar amounts when making withdrawals, deposits or transfers. Most do so by displaying a data field and prompting users to type a dollar amount using the ATM's keypad. However, ATM users who want to deposit $35.75 do not have to type "$35.75" or even "35.75". They just type "3575" and the machine places the digits in their correct positions relative to the decimal point. Users cannot enter arbitrary text into ATM dollar amount fields because alphabetic characters are just an alternative interpretation of the same keys as the digits 0-9, and the dollar amount field interprets the keys as numbers.
After all, the goal is presumably to design a GUI, in which the G stands for "graphical" not "textual".