Copy link to clipboard
Copied
Hello,
I have added some form fields on my form for some additional table row headings and lines in the document. The idea is that this additional formatting can be made "hidden" or "visible" by the user by clicking on a button.
However I am unable to fix the field value, for example a row heading, so that it doesn't clear even when the user accidentally clicks into the field while filling out the form in Adobe Reader. I have set the field property on "Locked", but that still means that the value clears if clicked into the field before defaulting back to original.
event.value="fieldName"; only makes the value appear in the field.
Can anyone help?
Thank you!
Copy link to clipboard
Copied
Set the field as read-only.
Copy link to clipboard
Copied
Thanks Bernd, sorry I forgot to mention that ReadOnly had the same effect as Locked as it still cleared the value once the user clicked into the field.
By the way, I think I just found a solution that seems to work by using a button with the formatting as a label, instead of a field.
Copy link to clipboard
Copied
This will not happen when the user fill the form with Acrobat Reader or Adobe Acrobat.
Copy link to clipboard
Copied
This is not normal behavior for a field. Could you share this file with us?
Copy link to clipboard
Copied
@Bernd Alheit and @try67
Thank you, unfortunately I cannot share the file due to company policy, however I tried it out in Acrobat Reader and if implemented as a button it definitely doesn't allow the user to click into it and whereby to temporarily clear the text (or the label, in this case), which is what I intended.
Just to be clear, the formatting that should become visible after the user clicks on another button specifically designated to make fields visible or hidden, has been entered into Button Properties under the Options tab, under Label. Say the button is "RowSeparatorLine" and the other button is "+". Once the user clicks on "+", the below script runs and "RowSeparatorLine" becomes visible.
var y=this.getField("RowSeparatorLine");
y.display=display.visible;
The only thing is that if the user accidentally hovers over "RowSeparatorLine", a small yellow window with the label appears so that the user knows that its actually a button and not just some text. Otherwise this just works as if it was text, and is the only option that I know that allows to make text on the PDF file visible or hidden (similar to LiveCycle Designer).
Find more inspiration, events, and resources on the new Adobe Community
Explore Now