Answered
Hello,
I am wondering if there is a way to Generate a random number in a numeric Field or any other type?
I am currently using LiveCycle Designer ES 8.2
thanks,
-Vargs
Hello,
I am wondering if there is a way to Generate a random number in a numeric Field or any other type?
I am currently using LiveCycle Designer ES 8.2
thanks,
-Vargs
// Returns a random integer between min and max // Using Math.round() will give you a non-uniform distribution! function getRandomInt(min, max){return Math.floor(Math.random() * (max - min + 1)) + min;} var random = getRandomInt(1, 6);xfa.host.messageBox( "Random number: " + random );
// Returns a random number between 0 (inclusive) and 1 (exclusive) function getRandom(){return Math.random();}
// Returns a random number between min and max function getRandomArbitary(min, max){return Math.random() * (max - min) + min;}
if (this.rawValue == null){var d = new Date();//divide by 1000 to get seconds and trim decimalsthis.rawValue = Math.floor(d / 1000);}else{this.rawValue = rawValue;}
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs