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

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

New Here ,
Feb 17, 2023 Feb 17, 2023

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
1.1K
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 ,
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;

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 ,
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;

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

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