Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

48

Likes

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

Adobe Community Professional , 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.

Likes

Translate

Translate
Adobe Community Professional ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

You can reset the form. 

Likes

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

Likes

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
Adobe Community Professional ,
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

Likes

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
Adobe Community Professional ,
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.

Likes

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