How to create a unique ID in a PDF using JavaScript

On RAC, I noticed a bid named “Create a small Interactive & Dynamic PDF Order Form in Adobe Designer”, said

I need a PDF ‘Order Form’ to be sent by email when completed. This form will auto generate a unique serial number, consist of radio buttons, check boxes, javascript validations(scripts), text fields, number fields, etc.
The [...]

Implementing e-forms with Adobe LiveCycle Forms

September 2007
E-FORMS
Most companies today use e-forms in some way or the other, ranging from the simple contact form with fields where customers can leave their e-mail address and a message, to complex multi-page forms incorporating calculations and logic. While most e-forms are still implemented using HTML - often accompanied by JavaScript to [...]