These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Prevent user input

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766

Hi,
 
I use a text field which displays a pop-up menu on the mouse-down trigger to fill the field : this is OK.
 
Now, I need the user to not being able to delete nor to enter any character in the field, how can I prevent that ?
 
I guess that I need a custom keystroke script, so I tried it… but all my trials also prevent any input from the popup menu…
 
Can someone show me the right way?
Please.
 
 
Download my sample PDF here: https://sendnow.acrobat.com/?i=DpKaNgCKrGr0n4QH*7Tweg

My Product Information:
Acrobat Pro 10.1, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Make the text field read-only, place a transparent button on top, and place the popupmenu code in the Mouse Up or Down event of the button.
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Thanks for your help,

in fact it's a little bit more complex task, sometimes I need the field to be pop-up only, and sometimes I need the field to be fillable.
Because some fields are reliant from other:

- field1 : user select ITEM1 => field2 value : ITEM-a => field3 value : free user input
- field1 : user select ITEM2 => field2 value : ITEM-b => field3 value : item-y
- field1 : user select ITEM3 => field2 value : free user input => field3 value : free user input
- and so on.

I didn't really care to prevent deleting, but I really need to prevent keyboard input.

Any ideas ?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Hmmm...I'm not sure I understand how you have it set up, but you'll have to find a way to test via JavaScript whether the field should be fillable or not. The custom Keystroke script could then set event.rc to false if the field should not be fillable.