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

Javascript help for Strikethrough in Adobe Forms based on entry of another field/box

New Here ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

I have 5 text box form fields names Box1, Box2....  A number will be entered in Box1 if a number is entered in Box2 then I want the format for the number in Box1 to be Strikethrough. Same for Box3 if number entered then Box 2 number to be strikethroughed and then follow for the rest of the boxes. I know who to enable strikthrough for one standalone box but not based other entry of another box.

TOPICS
JavaScript

Views

834

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

correct answers 1 Correct answer

Community Expert , Feb 17, 2023 Feb 17, 2023

Here is an example how to achieve it using richValue, script would go to "Box1" as custom calculation script:

var spans = new Array();
spans[0] = new Object();
spans[0].text = event.value;
spans[0].strikethrough = this.getField("Box2").value == "" ? false : true;
event.richValue = spans;

Votes

Translate

Translate
Community Expert ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

Here is an example how to achieve it using richValue, script would go to "Box1" as custom calculation script:

var spans = new Array();
spans[0] = new Object();
spans[0].text = event.value;
spans[0].strikethrough = this.getField("Box2").value == "" ? false : true;
event.richValue = spans;

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 ,
Feb 18, 2023 Feb 18, 2023

Copy link to clipboard

Copied

LATEST

Thanks Nesa. This worked perfectly. I had a similar script that may or may not of worked, but made the mistake of putting it in under the format tab and not the calculate tab. I am learning a lot by reading your answers to all your posts.

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