この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
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
表示
返信
いいね!の合計
Use this pattern for this purpose.
num{'00'9999999}
表示
返信
いいね!の合計
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?
表示
返信
いいね!の合計
Hi,
Try a display pattern of;
num{'000'9}|num{'00'99}|num{'0'999}|num{9999}
One digit will match the first pattern and add the '000' string, etc
Regards
Bruce
表示
返信
いいね!の合計
Thanks Bruce,
Someone else gave me the following and it works just fine:
if (event.value) {
event.rc = /^\d{5,7}$/.test(event.value);
if (!event.rc) app.alert("You must enter between 5 and 7 digits.");
}
Do you know where I can read up on: /^\d{5,7}$/.test(event.value)
Regards,
Jeff
Jeff Hill
Lions Clubs International
MSC Business Analyst
630-468-6759
Celebrating 100 Years of Service
Lions100.org<http://lions100.lionsclubs.org/EN/index.php>
“We Serve”
<http://lionsclubs.org/blog/>[ico-fb]<http://www.facebook.com/lionsclubs>[ico-yt]<http://www.youtube.com/user/lionsclubsorg> <http://twitter.com/lionsclubs> <http://www.linkedin.com/company/33854> <http://www.flickr.com/photos/lionsclubsorg/> <http://pinterest.com/lionsclubs/> <http://instagram.com/lionsclubs>
表示
返信
いいね!の合計
Hi,
Adobe Reader uses SpiderMonkey JavaScript, so you could start with RegExp.prototype.test() - JavaScript | MDN
There will be some things on that website that don't apply as Adobe Reader is still using a fairly old version 1.7 or 1.8
Regards
Bruce
表示
返信
いいね!の合計
If you use text, then they can put alpha characters in that field where he probably only wants numeric input.
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