Skip to main content
New Participant
December 28, 2021
Question

Text Box with Lines

  • December 28, 2021
  • 4 replies
  • 7283 views

How can I create a fillable text box with lines?

This topic has been closed for replies.

4 replies

JR Boulay
Community Expert
May 22, 2024

Ex3535 :

// ON FOCUS
if (event.target.value == event.target.defaultValue) {
	event.target.value = "";
	event.target.textColor = color.black;;
}


// ON BLUR
if (event.target.value == "") {
	event.target.value = event.target.defaultValue;
	event.target.textColor = color.ltGray;
}

 

 

Acrobate du PDF, InDesigner et Photoshopographe
Ex3535
Participating Frequently
May 23, 2024

I am truly grateful for this! Trying it now. THANK YOU ♥

JR Boulay
Community Expert
December 31, 2021

Hi Thom

 

I also have customers like yours.

In this case I leave the background transparent so that the lines are displayed, I place a script in an onFocus Action which changes the background in white as soon as the user starts the input, and a script in an onBlur Action which checks if the field as been filled. If so, it remains white, if not it becomes transparent again.

😉

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
December 31, 2021

Nice Solution!  I will keep this in mind. Thanks JR 🙂

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
JR Boulay
Community Expert
December 29, 2021

The underlines date from paper forms, you have to change the paradigm.

Users do not need those lines because it is not possible to write crookedly in a digital form, so just use a color (white) to hide lines that are on the layout.

🙂

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
December 29, 2021

Hi JR,

I like your way of thinking!! Unfortunately I run into this all the time. The paper mindset will be with us for a while. Customers insist on having lines for multiline inputs. We need to change this to using a box for multiline.   

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
December 28, 2021

Explain what you mean by "create a fillable text box with lines"

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
New Participant
December 28, 2021

I want to create a text box that has lines in it example:

____________________________________________

____________________________________________

____________________________________________

So that when you type it the words are above the line like on a piece of paper.

Thom Parker
Community Expert
December 28, 2021

The Appearance tab on the Form Field Properties window provides an option for an "Underline" on the field. I do not find this option very useful. Espcially since its only good for single line fields. 

It is much better to add the lines to the PDF Page, then place the form fields over the lines. 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often