Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I have no experience using javascript in a form. Where do I insert the code for that text field?
Thanks
Pat
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I created a new text field and then applied the script. No lines appear.
Thanks
Pat
Copy link to clipboard
Copied
Now add text to the field, move out of the field, get back in, delete the text, and move out again.
If everything was done correctly, you now should see lines which were originally covered by the field.
To confirm that, try with another field, and set the field's background to transparent as default.
Copy link to clipboard
Copied
I think I get it now. I create the text field OVER the existing lines………….
I’ll try it. Thanks
Pat