Copy link to clipboard
Copied
I have successfully figured out how to add a yellow background color to a field if it is empty (to alert a user to fill it out), but I cannot figure out how to get it back to transparent when the field is filled. I was able to figure how to get it be a white background, but that's not a solution as the background overlaps the lines of the form and looks odd. Normal backgrounds are transparent. I just want it to go back to "normal" when a user fills it out. I tried "color:none", but that doesn't seem to be a valid value?
// If field is blank, yellow background
if (!event.value) {
event.target.fillColor = color.yellow;
} else {
if (event.value) {
event.target.fillColor = color.white;
}
}
Use color.transparent
Copy link to clipboard
Copied
Use color.transparent
Copy link to clipboard
Copied
Oh. LOL. Thank you, Nesa. I didn't consider "transparent". I use "none" a lot in CSS so I assumed that was the code. THANK YOU!
Copy link to clipboard
Copied
When using this formula, the field only changes to yellow when I tab into the field, and changes back to transparent after tabbing out without entering any data. Is it possible to have the field (several on a document) background default as yellow when viewing, and then change to transparent as data is entered in those fields?
Copy link to clipboard
Copied
Where did you put script?
Use it as validation script.For the first time you will need to enter data in field and then delete for code to kick in or set it to yellow manually for the first time.