Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
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
Vues
Réponses
Nombre de J’aime
Use this pattern for this purpose.
num{'00'9999999}
Vues
Réponses
Nombre de J’aime
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?
Vues
Réponses
Nombre de J’aime
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
Vues
Réponses
Nombre de J’aime
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>
Vues
Réponses
Nombre de J’aime
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
Vues
Réponses
Nombre de J’aime
If you use text, then they can put alpha characters in that field where he probably only wants numeric input.
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
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
Vues
Réponses
Nombre de J’aime