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

i want a form to start with no option selected in the optionfield

Explorer ,
Jul 06, 2021 Jul 06, 2021

Dear specailists,

i want to start a form with no option selected in an optionsequence.

I added an example, where i test some other functionality with options. Sometimes it starts clean after having worked on the code, but sometimes not.

Is there a property I can set, that it starts clean all the time?

all the best

Ben

TOPICS
PDF forms
800
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
1 ACCEPTED SOLUTION
Community Expert ,
Jul 06, 2021 Jul 06, 2021
LATEST

All of your code is added at the field level, which means it will only execute when you interact with the fields in some way. If you want to add code that runs when the file is opened then you should place it as a doc-level script, via Tools - JavaScripts - Document JavaScripts.

View solution in original post

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 ,
Jul 06, 2021 Jul 06, 2021

You can reset the form. 

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
Explorer ,
Jul 06, 2021 Jul 06, 2021

hmm, a possibility. but I am afraid that this will reset all fields everytime, the form is used. But perhaps I do not understand, what you say. Is it possible to reset it only the first time, it s used? My form is used and saved with the answers, then opened again...

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 ,
Jul 06, 2021 Jul 06, 2021

If all you want to do is to clear the checkboxes while you are still developing the form, then either run this code in the console window, or put it on a button mouseUp.  You can always hide or delete the button when the form is finished.

 

this.getField("cBox").value = "Off";
this.getField("dBox").value = "Off";

 

You'll find a video on the console window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Jul 06, 2021 Jul 06, 2021
LATEST

All of your code is added at the field level, which means it will only execute when you interact with the fields in some way. If you want to add code that runs when the file is opened then you should place it as a doc-level script, via Tools - JavaScripts - Document JavaScripts.

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