Hi there,
I have a field that has a maximum of 6 numbers. If the user enters less than 6 numbers I would like zereos to fill in the front of the numbers to make the total length 6 numbers long. Is this possible?
Thank you for your help in advance.
Nik
Solved! Go to Solution.
Views
Replies
Total Likes
Set the display Pattern for this Numeric field to "num{999999}"..
Thanks
Srini
Views
Replies
Total Likes
Set the display Pattern for this Numeric field to "num{999999}"..
Thanks
Srini
Views
Replies
Total Likes
Nik,
If it is a text field you can do something like this to pad the leading zero's.
// form1.page1.tf::exit - (JavaScript, client)
if (this.rawValue != null) {
var tf = this.rawValue;
if (tf.length < 6) {
var diff = 6 - tf.length;
for (var i=0;i < diff;i++) {
tf = "0" + tf;
}
this.rawValue = tf;
}
}
If it is a numeric field you can use a display pattern of num{999999}.
Steve
Views
Likes
Replies
Views
Likes
Replies