Skip to main content
Inspiring
November 29, 2020
Answered

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

  • November 29, 2020
  • 1 reply
  • 558 views

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 has been closed for replies.
Correct answer Nesa Nurani

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
November 29, 2020

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;