Skip to main content
Participant
September 21, 2021
Answered

Conditional Formatting with a special character

  • September 21, 2021
  • 1 reply
  • 558 views

Hi,

I am trying to highlight form fields in a pdf if the data in the field contains an asterisk before the number, for example "*8.596" may be in the field.  I have searched through multiple threads in this community and feel like maybe I am close, but it is not working.  With the asterisk being a special character, I added the backspace.I am not getting an error, it is just not highlighting the field.  Right now I am using this:

if (event.value=="\**") event.target.fillColor = color.yellow;
else event.target.fillColor = color.transparent;

Any suggestions on what I am doing wrong?  

This topic has been closed for replies.
Correct answer try67

Replace:

(event.value=="\**")

With:

(/^\*/.test(event.value))

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 21, 2021

Replace:

(event.value=="\**")

With:

(/^\*/.test(event.value))

Participant
September 27, 2021

Thank you so much for your help.  It works!