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

How to hide writing line in a fillable pdf?

New Here ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

I have searched all over and can not seem to figure this out. I have 100+ pg workbook. 

I want it to have lines in case someone prints it out and wants to fill it out. But it also needs to be fillable. Since I can't control the line height when I make it fillable, I want to make the lines disappear (don't really need them when typing anyways). 
So what I would love to make happen is when the field is clicked on, the field background color becomes white but I can not get that figured out to save my life! I think I need to create a javascript to do this but everything I try isn't working. Does anyone know how? Here's a loom video walking thru it:
Screenshot 2023-02-15 at 12.14.06 PM.png
TOPICS
Create PDFs , JavaScript , PDF forms

Views

1.4K

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

correct answers 1 Correct answer

Community Expert , Feb 15, 2023 Feb 15, 2023

That's a one-way street, though. I would do it using the On Focus and On Blur events.

The On Focus script will be:

event.target.fillColor = color.white;

 

The On Blur script will be:

if (event.target.valueAsString=="") event.target.fillColor = color.transparent;

 

That way the lines will become visible once more when the user exits the field, if it's empty.

Votes

Translate

Translate
Community Expert ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

To change field background color to white when it's clicked, run this script as 'Mouse Down' action:

event.target.fillColor = color.white;

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 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

THANK YOU SO MUCH!!! It worked like a charm!

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 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

That's a one-way street, though. I would do it using the On Focus and On Blur events.

The On Focus script will be:

event.target.fillColor = color.white;

 

The On Blur script will be:

if (event.target.valueAsString=="") event.target.fillColor = color.transparent;

 

That way the lines will become visible once more when the user exits the field, if it's empty.

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 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

LATEST

This is a BETTER solution! Thanks!!!

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