1 Reply Latest reply on Oct 11, 2014 4:11 PM by gkaiseril

    Help JavaScript code to form Acrobat XI

    ALDI Level 1

      This form must Text Field, Check box and Dropdown list. The action of this JavaScript is that when the form is saved using the options Save or File> Save As only Text Field, Check box and Dropdown list that have been used to pass Read only and NOT those that the user does not use.


      What you want to achieve with this action is:

      • Save the data written to it can not be edited.
      • Allow user to finish filling out the form on another occasion.


      The JavaScript that follows requires me to put in the Dropdown list as default value (Select  one) otherwise all the passes to Read only and the user can no longer use those that I do not use at the time of storage. Otherwise, it works great.



      for (var i=0; i<this.numFields; i++) { 

          var f = this.getField(this.getNthFieldName(i));

          if (f==null) continue; 

          if (f.type=="button") continue; 

          if (f.readonly==false && f.value!=f.defaultValue) { 

              f.readonly = true; 



      Please, I need to correct this JavaScript to NOT force me to put the default (Select one) in the drop down lists and run this action only in those in which the user select an option from the list.


      Thanks to all who work in this forum.