How do I create a Machine Name type of field? I need to add a Machine Name type of field to Nodes of a certain Content Type. It's the same Machine Name field that Drupal is using when creating Content Types.


  Example: If I enter "My Title" in the title field, the Machine Name
  field will be populated with "my_title" via javascript.


Why do I need it? I am referencing nodes to other nodes and want to generate an URI, based on a node referenced, i.e. example.com/node-referenced/node-content
There is a machine_name element type for the Form API, but it appears there is no machine name field type in core or in a contrib module. From there, I see three code-driven solutions:


It should be possible to crudely alter your node form to replace a text-field widget with a machine name element,
but the proper way would be to define a new Field API widget type based on the machine name Form API element type.
You can also not use the Field API for, directly add a machine name element in your node edit form through a form alter hook and handle storing it's value yourself.