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

Comma Logic for one of many fields with same name.

Community Beginner ,
Oct 03, 2023 Oct 03, 2023

Copy link to clipboard

Copied

Hello there community!

I have been looking for a script that I can put into a text field that places a comma at the end of the text/ string. I found this little bit on another post: if (event.value) event.value+=","; this works 100% but I need to customize it a bit. I have 5 text fields that are identical in name that pull in information from a database but I only need that snippet of logic applied to the first instance of textbox. So, all 5 boxes will populate a client name but I only need comma logic applied to the first box. As it stands now, using just this tidbit in the first textbox produces a comma across all boxes which makes sense.   Any help or advice would be appreciated!

TOPICS
Create PDFs , Edit and convert PDFs , How to

Views

527

Translate

Translate

Report

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 03, 2023 Oct 03, 2023

Copy link to clipboard

Copied

You will have to rename this field and copy its value from the others, or vice versa.

Votes

Translate

Translate

Report

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 Beginner ,
Oct 04, 2023 Oct 04, 2023

Copy link to clipboard

Copied

Nice! Didnt think of this before. Thank you!

Votes

Translate

Translate

Report

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 ,
Oct 04, 2023 Oct 04, 2023

Copy link to clipboard

Copied

Hi, could you please show me step-by-step instructions? I renamed the field and copied the value from the other but it did not seem to work. Thank you so much. 

Votes

Translate

Translate

Report

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 Beginner ,
Oct 04, 2023 Oct 04, 2023

Copy link to clipboard

Copied

Take whatever field that you need the comma inserted at the end of the name at and open up you calculation tab in the field properties. I inserted this: this.getField("yourNameComma").value = this.getField("otherFields").valueAsString; in the custom calculation. the "yourNameComma" being the title of the text field that needs the comma appended and "otherFields" being the other fields that you have that need the name but not the comma. Then I went into the format tab in properties of the name field that needs the comma appended and added: if (event.value) event.value+=","; in the custom format script area. Hope this helps!

Votes

Translate

Translate

Report

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 ,
Oct 04, 2023 Oct 04, 2023

Copy link to clipboard

Copied

LATEST

AWESOME! It worked. Thank you very much for your help. 

Votes

Translate

Translate

Report

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