Skip to main content
Participating Frequently
June 11, 2016
Question

Lines in text boxes

  • June 11, 2016
  • 1 reply
  • 714 views

I am redoing forms for a local police department. They need fillable text boxes that have horizontal lines the text follows. They want the option of printing the form with the blank lines when they cannot fill the form electronically.

I have added lines using commenting and "eyeballing" their position between the lines of text. Is there an easier way?

Thanks

Pat Freel

Madison, AL

This topic has been closed for replies.

1 reply

Brainiac
June 12, 2016

This is a situation which has been around for a long time.

One approach is to create those writing lines as part of the contents of the form (in other words, in the layout software). So, if the user prints the blank form, he has the writing lines.

Now, if the form is filled on screen, those writing lines are more an annoyance than useful. And they are not needed, because text in a field will always be well aligned.

With a little bit of JavaScript, we can have both options. In the Format event, you could add the following custom script:

if (event.value.toString().length > 0) {

event.target.fillColor = color.white ;

} else {

event.target.fillColor = color.transparent ;

}

If there is something in the field (the length of its value as string is greater than 0), the background of the field is white, and covers he writing lines. Otherwise, the background is transparent, and the lines are visible.

Hope this can help.

Pat FreelAuthor
Participating Frequently
June 12, 2016

I have no experience using javascript in a form.  Where do I insert the code for that text field?

Thanks

Pat

try67
Brainiac
June 12, 2016

In Form Edit mode, right-click your field and select Properties. Switch to the Format tab and then select Custom and enter the code under the Custom Format Script option.