field widget with multiple input fields
As well as their schema and other basic definitions, fields have


Widgets


  Field API widgets specify how fields are displayed in edit forms. Fields of a given field type may be edited using more than one widget. In this case, the Field UI module allows the site builder to choose which widget to use. Widget types are defined by implementing hook_field_widget_info().

Formatters


  Field API formatters specify how fields are displayed when the entity to which the field is attached is displayed. Fields of a given field type may be displayed using more than one formatter. In this case, the Field UI module allows the site builder to choose which formatter to use. Field formatters are defined by implementing hook_field_formatter_info().



Each field needs a widget and formatter to do anything useful, but they don't necessarily have to be implemented by the same module that implements the field. For example, you could piggyback off of one of the select widgets if that made sense for your field.

For full code examples, check out the Examples module