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

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

Explorer ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

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

Views

416

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jul 06, 2021 Jul 06, 2021

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.

Votes

Translate

Translate
Community Expert ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

You can reset the form. 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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