Generate random numbers on input fields

  1. Adding Custom Attributes: In the field settings, you'll find an area where you can add custom attributes and their values. These attributes will define how the random number is generated for this input field. Add the following attributes:
    • Attribute Name: random-number
    • Attribute Value: yes
    This attribute tells the JavaScript code to generate a random number for this input field.
  2. Adding Number of Digits (Optional): If you want to specify the number of digits for the random number, you can do so by adding another custom attribute:
    • Attribute Name: random-number-digits
    • Attribute Value: Specify the number of digits you want for the random number. For example, if you want a 4-digit random number, set the value to 4.
    If you leave this attribute blank, the code will default to generating a 6-digit random number.
  3. Adding Prefix (Optional): If you want to add a prefix to the generated random number, you can add the following custom attribute:
    • Attribute Name: random-number-prefix
    • Attribute Value: Enter the desired prefix for the random number. For example, if you want the prefix to be "NMB," set the value to NMB.
    If you don't want to add a prefix, simply leave this attribute blank.
  4. Saving Changes: After adding the custom attributes, make sure to save the changes you've made to the field settings.

Have more questions? Submit a request