Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Creating a form field that doesn't clear when user clicks into it

New Here ,
May 05, 2021 May 05, 2021

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!

 

 

 

 

TOPICS
How to , JavaScript , PDF forms
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

Set the field as read-only.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 05, 2021 May 05, 2021

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

This will not happen when the user fill the form with Acrobat Reader or Adobe Acrobat.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

This is not normal behavior for a field. Could you share this file with us?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2021 May 06, 2021
LATEST

@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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines