In Livecycle forms make all negative values red

671 views Asked by At

I'm building a form in Adobe Livecycle and would like all negative numbers to display in red. I can accomplish that on individual elements by attaching this code to the exit event:

form1.#subform[0].Table3[0].HeaderRow.concessions1::exit - (FormCalc, client)    
if ($.rawValue <0) then
        $.font.fill.color.value = "255,0,0"
        else
        $.font.fill.color.value = "0,0,0"
    endif

Currently I have to add this code to every single field, is there a way to make this script run on multiple fields without retyping it for each one?

Thanks

1

There are 1 answers

0
Armaghan Chaudhary On

your options are:

  1. Externalize the code in a script object and call the method on the exit event. You can pass the field as an input parameter so that your code is generic.

  2. If you want to do this before a form is submitted, you can create a method that loops through your form fields and reference this code to highlight the negative values.

I hope this helps. Let me know if you have any more questions.

Thanks, Armaghan.