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

Yes / No / Blank display pattern anyone.

zbrd
Registered: Nov 17 2008
Posts: 11
Answered

Does anyone have a display pattern for a text field that will only allow:
Y
N
' ' (blank)
 
I sure can't figure out how to do it in LiveCycle 8.
 
WindowsXP, Acrobat LiveCycle 8.
 
Thanks in advance

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Such things cannot be realized by a pattern.
Therefore you need something like a regular expression.
You can use a script like this in the change event of the field
  1. if(xfa.event.newText.match(/[^NY\.]/))
  2. {
  3. xfa.event.change = "";
  4. }

Or simply use a dropdown box for this purpose.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

zbrd
Registered: Nov 17 2008
Posts: 11
Thanks, I was going crazy trying every combination trying to make it work.

So where do I put this "event" on the exit event of the field ?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Put it into the change event!
It will cause that the users can only type in N or Y, nothing else.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs