Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Alerte en cas de dépassement du nombre de caractères

New Here ,
Apr 28, 2023 Apr 28, 2023

Bonjour,

Je crée un formulaire sur Adobe Acrobat Pro et je souhaiterais pouvoir afficher un message d'erreur lorsque la personne a atteint la limite de caractères autorisée par le champ de texte.
Je sais limiter le nombre de caractères, mais la personne qui remplit n'est pas informée lorsqu'elle atteint la limite. Si elle copie-colle un texte trop long, la fin ne sera pas prise en compte et elle ne le saura pas. Je voudrais avoir un message "Attention, vous avez atteint la limite de X caractères."
Est-ce possible ?

Merci d'avance

TOPICS
PDF forms
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Apr 28, 2023 Apr 28, 2023

Yes, using a script. Remove the Character Limit setting and instead use this code as the field's custom Keystroke event (under Properties - Format - Custom):

 

 

if (AFMergeChange(event).length>10) {
	app.alert("Attention, vous avez atteint la limite de 10 caractères.",1);
	event.rc = false;
}

 

 

It's possible the code will "disappear" after you apply it, due to a bug in Acrobat, but it should still work.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2023 Apr 28, 2023

Yes, using a script. Remove the Character Limit setting and instead use this code as the field's custom Keystroke event (under Properties - Format - Custom):

 

 

if (AFMergeChange(event).length>10) {
	app.alert("Attention, vous avez atteint la limite de 10 caractères.",1);
	event.rc = false;
}

 

 

It's possible the code will "disappear" after you apply it, due to a bug in Acrobat, but it should still work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2023 Apr 29, 2023

Super, ça fonctionne ! Merci !!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 25, 2023 Aug 25, 2023

Bonjour,

Ce code m'interesse mais je ne sais pas où le "coller".

En effet dans le menu (under Properties - Format - Special), je ne peux pas coller de code. Et dans  Properties - Format - personnalisée je ne sais pas où le mettre. Du coup ce code est inactif dans mon formulaire. 

Version ADOBE ACROBATE PRO version 2023.003.XXX

Merci pour votre aide

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2023 Aug 25, 2023

Sorry, I made a small mistake above. It should go under Properties - Format - Custom, not Special.

Then use the Keystroke event (the lower of the two):

 

try67_0-1692955450446.png

 

 

Click Edit and then paste the code into the window that opens. Like I said, it's possible the code will "disappear" after you do that, but it should still work.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 25, 2023 Aug 25, 2023
LATEST

TOP !!! merci...

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 25, 2023 Aug 25, 2023

Merci pour votre réponse et votre aide !

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines