Copy link to clipboard
Copied
Hello. I am using a cutom validation script to enter leading zeros in a text box.
(function() { var max_len = 9; var val = event.value; while (val.length < max_len) {val = "0" + val;} event.value = val; })();
The problem arises when the value is null the field reports "000000000." I would like for it to be blank if null.
Any help would be greatly appreciated!
Copy link to clipboard
Copied
Use this:
if (event.value==0) event.value = "";
else {
// rest of code goes here
}
Copy link to clipboard
Copied
Use this:
if (event.value==0) event.value = "";
else {
// rest of code goes here
}
Copy link to clipboard
Copied
Perfect!! Thank you so much 🙂
Copy link to clipboard
Copied
Hello,
Can please someone help me with this custom script.
why is that only work on pc, when I open the same PDF with my android Mobile, The Zeros are comming back.
Thank you.

