In some cases, The form builder is used for far more than just a form. I have a customer that has a very detailed form for a Mailing Request. How great would it be that after the form submission, you get a Order Number. A random generated order number. It would be on the success message of course. As well as Email Notifications. We can even include it as [order-number] as the ID.
The Order Number should have these options
Prefix to add before the number
Suffix to add after the number
Length of the random number
Option to include letters
This would also help my customer find on the spreadsheet with all the submissions, search by order number.
This code should be added to the Custom JS section on the Settings tab of your widget’s settings.
You can adjust the prefix, suffix and number length in the first 3 lines of the code. Devs recommended using the number length starting from 8 to avoid the possible repetitions.
Test it out and let me know if you like the result
Awesome! I just tested and it worked. 1 issue, the code is not showing up in email when i put the id [order] and would it be possible to show in the excel also? It’s only showing correctly in the success message.
The devs are more than welcomed to test the form themselves if it’s easier. My client is aware about the widget.
To make the code work correctly, you need to a hidden field with the name “Order to your widget”. This way the order number will be displayed in spreadsheets and submissions as well: