Machine name

Last updated on
1 October 2016

Problem

Some forms that ask the user to specify a name will also need a database/code friendly version of that input – the "machine name". This requires the user to enter the same value twice, with an understanding of how to create a "sanitized" version of the text.

Solution

Screenshot of the machine name pattern

Automatically create the machine name version of the human readable input, hiding the "Machine name" field behind an [Edit] link.

Use when

  • You need to generate a machine friendly version of human-readable input

Recommendations

  • Should only be used for generating machine names

API

Drupal 7

Help improve this page

Page status: No known problems

You can: