Skip to main content
Inspiring
Nov 29, 2020 12:10 AM UTC
Answered

Changing prefilled date field entry data to white based on another empty field

I have a voucher form which when digitally signed, it autmatically inputs the current date in the "Date" field across from the digital signature.  The voucher has room for three itemized line listings, with a "Date1, Date2 & Date3" fields at the beginning of each.  I want the three subsequent "Date" fields to automatically input the same date I digitally sign the document (pull the same date from the "Date" field), but since I may only have one or two itemized line listings on the voucher, I don't necessarily want the "Date" fields on the empty line items to be displayed.  I'm wondering if there's a script to pull data from one field, but only if a different field contains dats.  Another thought would be to color code the "Date2" "Date3" fields in some manner that the data displays as "white" if another specific field (i.e. "SubAmount2", "SubAmount3") in that line item does not contain any data, and data displays as "black" if the same specificed field in that line item does contain data.  Any help would be greatly appreciated.

This topic is closed to new replies. Start a new post to keep the conversation going.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Nov 29, 2020 7:49 AM UTC

Not sure I understand you right , but if you wish to change text color of a field depending on another field value you can use this:

event.target.textColor = this.getField("SubAmount2").value != "" ? color.white : color.black;

 

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Nov 29, 2020 7:49 AM UTC

Not sure I understand you right , but if you wish to change text color of a field depending on another field value you can use this:

event.target.textColor = this.getField("SubAmount2").value != "" ? color.white : color.black;

 

Translate