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
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.
Copy link to clipboard
Copied
You can reset the form.
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...
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
Copy link to clipboard
Copied
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.