• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
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

Copy link to clipboard

Copied

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

Views

324

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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