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

Mehrere Formatierungen in einem Textfeld zulassen (Zahl mit Punkt oder Komma als Trennzeichen)

New Here ,
Jan 19, 2022 Jan 19, 2022

Hallo zusammen,

ich möchte in ein mehrsprachiges Formular in Adobe Acrobat Pro erstellen.

In diesem Formular sollen in einigen Feldern nur Zahlfelder mit zwei Dezimalstellen zugelassen werden.

So weit so gut. Bis hierhin alles kein Problem.

 

Jetzt kommt das "ABER"

Bei der deutschen Schreibweise wird ein Komma als Trennzeichen, bei der englischen Schreibweise ein Punkt als Trennzeichen für die Zahlen verwendet. Ich kann in den Einstellungen aber nur entweder oder definieren. (Trennzeichen 1.234,56 oder 1,234.56)

Ist es irgendwie möglich, beide Formatierungen in einem Feld zuzulassen?

z. B. 83,25 und 83.25

 

Evtl. lässt sich das alles über ein benutzerdefiniertes Formatierungsscript lösen. Hierfür benötigt man allerdings Kenntnisse mit JavaScript. Die habe ich leider nicht.

Für Tipps wäre ich sehr dankbar.

TOPICS
How to , JavaScript , PDF forms , Standards and accessibility
799
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 ,
Jan 19, 2022 Jan 19, 2022

J'ai eu le même problème avec le format Français.

Ce que j'ai réussi à faire avec JavaScript requiert d'attribuer un des deux formats au champ, il faut choisir lequel sera affiché.

Si par exemple j'utilise le format avec la virgule, quand l'utilisateur saisi le "point" il est automatiquement remplacé par une virgule.

Et vice-versa si on utilise le format avec le point.

 

Mais ça ne fonctionne pas avec les nombres négatifs.

Je peux partager un exemple si ça vous intéresse.


Acrobate du PDF, InDesigner et Photoshopographe
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 ,
Jan 21, 2022 Jan 21, 2022

Ja, mich würde ein Beispiel seht interessieren. Vielen lieben Dank

 

traduction automatique:

Oui, je serais très intéressé par un exemple. Merci beaucoup

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 ,
Jan 21, 2022 Jan 21, 2022

Do you have some kind of general "switch" that changes the pages from one language to another? If so, you could use it to also change the formatting of the fields, but it will require using a custom-made script.

You can't have both formats enabled at the same time, as they overlap. Is "1,101" "one thousand, one hundred and one" or "one and a hundred and one thousandths"? It could be either one, depending on the format used...

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 ,
Jan 21, 2022 Jan 21, 2022

Vous m'avez fait chercher un peu plus avant et du coup j'ai trouvé beaucoup plus simple et qui fonctionne avec les nombres négatifs. 😉

 

Placez l'un ou l'autre de ces scripts en "Custom Format Script" :

 

//  AVEC VIRGULE - WITH A COMMA

if (event.value && !isNaN(Number(event.value))) {AFNumber_Format(2, 3, 0, 0, "", false);}

 

// AVEC UN POINT - WITH A DOT

if (event.value && !isNaN(Number(event.value))) {AFNumber_Format(2, 1, 0, 0, "", false);}

 

Capture_97.png

 

 

 


Acrobate du PDF, InDesigner et Photoshopographe
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 ,
Feb 09, 2022 Feb 09, 2022
LATEST

Vielen lieben Dank,
die Formel "Mit Comma" funktioniert. Wenn ich hier einen Wert mit Punkt eingebe dann wird der Punkt automatisch durch ein Komma ersetzt.

 

Bei der zweiten Formel "With a dot" passiert aber leider gar nichts. Wenn ich hier eine Zahl mit Komma schreibe bleibt diese unverändert mit Komma. Wenn ich eine Zahl mit Punkt schreibe bleibt diese ebenfalls unverändert mit Punkt. Sollte die Zahl hier nicht automatisch mit Punkt geschieben werden?

 

Danke für die Hilfe

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