Copy link to clipboard
Copied
I have a standard form where there is a portion of the field which has pre-drawn lines for the form.
The lines need to stay for those times the form is printed and filled in by hand. However, when completed by computer, I want the lines hidden so the multi-line text typed in is not obstructed by the lines.
My thought was to make the field with a white fill background, which would hide the lines, and have the field only visible when clicked on, and then it could be filled in. Here are the settings I selected:
With these settings I am unable to click on the field at all, so this part of the form can't be completed. I would like to get this working, or if there is a better way to accomplish the same goal I can give that a try as well.
Sorry, I made a mistake in the code... The last line should be:
f.display = (f.value=="") ? display.noPrint : display.visible;
Copy link to clipboard
Copied
No, that's not going to work.
You can attempt to line the text in the field with the lines, or you can use a script to show/hide this field when the document is printed, if it's empty.
So you can use the following script as the document's Will Print event:
var f = this.getField("Field name goes here");
f.display = (f.value=="") ? display.noPrint : display.visible;
This will cause the field to be hidden on the print-out (if it's empty), but still to be visible on the screen.
Edit: fixed the code
Copy link to clipboard
Copied
Not sure what you mean by line the text in the field. I tried the script, but I don't think it accomplishes what I need. If I don't change the property of the field to a white fill, then the pre-printed lines will still be there and make the text in the field unreadable. If I do change the fill color, then when I fill in the form it prints fine, but if there is nothing in the field it prints blank, meaning it is picking up the fill color of the field property, rather than ignoring the field. Perhaps something is not correct in my transcription of your suggested script?
Copy link to clipboard
Copied
If you don't put anything into the field it will be hidden on the print-out, meaning the lines underneath it will be visible. The fill color of the field doesn't matter in that case.
Copy link to clipboard
Copied
Sorry, I made a mistake in the code... The last line should be:
f.display = (f.value=="") ? display.noPrint : display.visible;
Copy link to clipboard
Copied
With that code when I fill in the field it doesn't print the field, so the code is now blocking the field entirely. The property of the field keeps changing in the properties box depending on whether I filled in the field or not. The javascript should not be actually changing the property of the form, but should execute an action, shouldn't it?
Copy link to clipboard
Copied
The display property is a property of the field... If you change it with a script it will also change in the Properties window. I'm not sure what's the problem with that.
Is it working or not working, then?
Copy link to clipboard
Copied
Not working. With text in the field, it will display on screen with text, but will print just the blank lines, which means it will bypass the field. If I look at the field property, it say visible but doesn't print, which is why I asked my question. So right now it won't print the field whether blank or filled, unless I manually go into the property and change the field to visible.
Copy link to clipboard
Copied
It will change again if you enter a value into the field and print the file
again... If you still can't get it work you can send me the file (try6767
at gmail) and I'll check it out.
Copy link to clipboard
Copied
Thanks, got it working now.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now