I have a requirement that I need to dynamically create x number of fields based on a supplied int value from a text box.

Example: There is a software content type. A user goes to add a new piece of software into the system. They received 11 keys/licenses with their purchase. The users enters 11 into a textbox, and then 11 license key fields display. The users enters in the 11 license keys and saves.

Hopefully that makes sense? Just looking for help deciding which fork in the road to take..

  • Edit your field, and change the limit from 1 to Unlimited. Will that do?
    – No Sssweat
    Jan 30, 2016 at 4:35
  • Unfortunately no that will not work in my situation. Jan 30, 2016 at 5:24
  • hummm, I don't think there is a way because fields are attached to content types and not nodes.
    – No Sssweat
    Jan 30, 2016 at 5:56
  • You could put all 11keys into 1 field, ex: body field, but I doubt this will do for you.
    – No Sssweat
    Jan 30, 2016 at 5:59
  • Just wondering, what are you planing to do with these license keys? What is the purpose of having them on separate fields?
    – No Sssweat
    Jan 30, 2016 at 6:00

2 Answers 2


you should look into


This module is useful for people that plan on integrating a software licensing system on their site.

Features Out of the box, it provides the following:

  • Ability to generate, edit & delete unlimited unique license keys.
  • Ability to export your keys into a CSV document, which you can mail merge and distribute with physical copies of your product.
  • Ability for users to 'register' their key when they sign up for a drupal account, or by visiting a page when logged in.
  • Users can have multiple keys registered to one account, and they are all displayed on their user page.
  • Provides views functionality for default and custom reports.
  • Brandable license keys like XXXX-BRAND-XXXX-XXXX-XXXX
  • This module does provide functionality out of the box, however - it's power is in the hooks it provides which allow you to extend this further.

Commerce Product Key

This module lets sites implementing the Commerce module, attach product keys to orders. Product keys / Vouchers are strings of text that are used to unlock or activate a piece of software.


It's a tricky one but my suggestion is to create a licensing field in the Software node type which has unlimited cardinality (I know you said above that approach will not work but you did not elaborate).

Then, use jQuery to control the number of the fields which display depending on the number provided in the 'count' textfield.

Not the answer you're looking for? Browse other questions tagged or ask your own question.