Hello:
I'm new to programming (FormCalc & JavaScript) and I'm using Adobe LiveCycle Designer ES 8.2 to create a dynamic form to post online. I need help with creating a "random letter & number generator" in code. The purpose is when someone opens the form online; I will create a unique number/letter combo on the form.
Any help or direction would be much appreciated. Thanks!
use a blank form (Javascript)
put a button on it with the following code in the click or up event:
console.clear();
console.show();
// Random Number between 1 and 26
var myRN = Math.random(); // Seed
console.println("Random Seed is: " + myRN); // object for debugging
var lowerBoundary = 1;
var upperBoundary = 26;
console.println("Random # is: " + Number(Math.floor(myRN*(upperBoundary - lowerBoundary))+ lowerBoundary ));
// Random uppercase Letter
var lowerBoundary = 65;
var upperBoundary = 90;
console.println("Random UpperCase Letter is: " + String.fromCharCode(Math.floor(myRN*(upperBoundary - lowerBoundary))+ lowerBoundary));
// Random Lowercase Letter
var lowerBoundary = 97;
var upperBoundary = 122;
console.println("Random LowerCase Letter is: " + String.fromCharCode(Math.floor(myRN*(upperBoundary - lowerBoundary))+ lowerBoundary));