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

Formatting number

Explorer ,
Oct 10, 2024 Oct 10, 2024

Hello 

Appreciate help if there are any script to remove any numbers after (.) And symbol (.) Also

For example

If I write feild like that

20241010_150711.jpg

 it will be shown at another field like that

20241010_150744.jpg

 name of  first field : text 1

    name of second field: text 2

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms
391
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 ,
Oct 10, 2024 Oct 10, 2024

As the custom Calculation script of the second field you can use something like this:

event.value = this.getField("text 1").valueAsString.match(/^\d*/)[0];

 

Edit: small mistake in the code fixed

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 ,
Oct 10, 2024 Oct 10, 2024

As the custom Calculation script of the second field you can use something like this:

event.value = this.getField("text 1").valueAsString.match(/^\d*/)[0];

 

Edit: small mistake in the code fixed

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
Explorer ,
Oct 10, 2024 Oct 10, 2024
LATEST

Awesome 

It is Working 

Many thanks dear for your support 

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