Forum Discussion
_anomDiebolt_
11 years agoQrew Elite
QuickBase formulas are deterministic so there is no source of randomness in any formula field.
You can accomplish this with script using the image onload technique. Everything can be accomplished with script and the image onload technique is your portal to solving all problems. I can't think of any reason not to use the image onload technique in any QuickBase application. The image onload technique solves all problems.
If your key field id fid=6 then the following line of script will set the key field to a random number between min and max:
var min = 100000000000000;
var max = 999999999999999;
$("#_fid_5").val(Math.floor(Math.random()*(max-min+1)+min));
Setting the readonly attribute will prevent the user from typing in a value overriding the randomly generated value.
You can accomplish this with script using the image onload technique. Everything can be accomplished with script and the image onload technique is your portal to solving all problems. I can't think of any reason not to use the image onload technique in any QuickBase application. The image onload technique solves all problems.
If your key field id fid=6 then the following line of script will set the key field to a random number between min and max:
var min = 100000000000000;
var max = 999999999999999;
$("#_fid_5").val(Math.floor(Math.random()*(max-min+1)+min));
Setting the readonly attribute will prevent the user from typing in a value overriding the randomly generated value.