8 Replies Latest reply on Oct 25, 2016 12:45 PM by re:treat

    I want to create a text box that only allows a tick, N/A, A, R, X & D and will auto capitilise.  I have 42 of these text boxes on my document!


      I am trying to create 42 text boxes that will only allow the user to enter the following: a tick (check), N/A, A, R, X & D.  I would also like it to auto capitalise.  I'm using acrobat pro & am very new to form design and javascript.  I would appreciate any help because the coding I've found so far doesn't work!

      I have entered as custom keystroke script


      // Allow just the letter specified

      function alphaOnly_ks()

      event.change = event.change.toUpperCase()


      and in my page actions:


      // Allow just the letter specified

      function alphaOnly_ks() {


          // Get all of the characters that have been entered in to the field

          var value = AFMergeChange(event);


          // Do nothing if field is blank

          if(!value) return;


          // Reject the entry if the entry doesn't match the regular expression

          if(!AFExactMatch(/^[✓,N/A,A,R,X,Dn/a,a,r,x,d\s\/]+$/, value)) event.rc = false;