Copy link to clipboard
Copied
For example,
I have 10 numbers blank _ _ _ _ _ _ _ _ _ _
When I input "123456" , I want the blank fill with "0000123456".
How to do this on Prepare Form?
Copy link to clipboard
Copied
As validation script of field where you input number use this:
function zeroes(number, length) {
var str = "" + number;
while(str.length < length){
str = "0" + str;}
return str;}
if(event.value != "")
event.value = zeroes(event.value,10);
Copy link to clipboard
Copied
Here's a slightly more compact method
event.value = ("0000000000" + event.value).slice(-10);
or
event.value = util.printf("%010d", event.value);
This could be used as either a format or validation script