Skip to main content
New Participant
February 17, 2023
Answered

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

  • February 17, 2023
  • 1 reply
  • 1300 views

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.

This topic has been closed for replies.
Correct answer Nesa Nurani

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;

1 reply

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
February 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;

New Participant
February 18, 2023

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.