13-08-2008
pguerett
pguerett
14-08-2008
14-08-2008
pguerett
pguerett
14-08-2008
14-08-2008
wandererers
wandererers
13-10-2010
Hello,
I am having the same problem. I need to retain an ID number that always starts with 2 0s and is 9 digits long as in 009999999. I have tried the numerous num {99...} combinationz with z's and nums and nothing has worked. However, you mentioned saving as 'text' and converting to 'int'. How do I do that? Any help is greatly appreciated.
Thanks
radzmar
MVP
radzmar
MVP
13-10-2010
Use this pattern for this purpose.
num{'00'9999999}
Liefie2000
Liefie2000
31-10-2011
If you use text, then they can put alpha characters in that field where he probably only wants numeric input.
Steve_L_Walker
Steve_L_Walker
31-10-2011
There's always code. For a text field with a max length of 9.
// form1.page1.tf-numeric-only::exit - (JavaScript, client)
if (!(this.isNull)) {
var tf = this.rawValue;
// \D to match any character NOT in the range 0 - 9
var regExp = /\D/;
if (regExp.test(tf)) {
xfa.host.messageBox("The field must be numeric.");
}
else {
if (tf.length != 9) {
xfa.host.messageBox("The field must contain 9 digit.");
}
else {
if (tf.substring(0,2) != "00") {
xfa.host.messageBox("The field must start with '00'.");
}
}
}
}
Steve
still-learning-
still-learning-
07-12-2016
So If I wanted 4 digits and retain leading zeros in the display I would use num{'000'9}?
Where does that go on the Validate tab in the custom validation script?