Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Best way to color change text box and make it stick once you click out of it.

New Here ,
Feb 01, 2021 Feb 01, 2021

I have a chart that people will fill out with custom text. However, not every box in the chart will be completed. What is the best way to have the text boxes that are completed change colors so they stand out once you click off of them? I can get the boxes to change color when you type into it but it won't stick once you click into another text box. I've tried various validation statements, but nothing seems to work. I'm at a loss. Do I need an if than statement? I'm not the best at JavaScript. Thanks in advance.

 

defaultt2yhq1ra2rhz_0-1612196850765.png

 

TOPICS
Edit and convert PDFs , JavaScript
608
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2021 Feb 01, 2021

You can use On Blur event of text field.

Go to field properties -> action tab and select 'On Blur' -> 'Run a javascript' and add this code:

event.target.fillColor = color.blue;

Change color if you wish, I just used blue as an example.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 01, 2021 Feb 01, 2021

Thanks! That worked, but when I click out of the cell the color disappears. Do you know of a way to make the color stay when you click off of it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2021 Feb 01, 2021

Thats because you have turned on field highlight, you can turn it off in preferences

but it won't work for other users, because they need to turn it off also in their software.

Izrezak.PNG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 01, 2021 Feb 01, 2021
LATEST

Thank you! I didn't know that was possible! Thanks so much for the tip! You're a life saver 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines