PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________
Despite the fact that I am not from Samaria, this one should work. You would put it into the Keystroke event of the field.
if (!event.willCommit) {event.rc = event.change.match(/[AB]/)} ;
This will only let through A and B, and nothing else. It will also not get any feedback to the user. If you want to get feedback, that elegant one-liner will not do it anymore, but you would use:
if (!event.willCommit) {
if (event.change.match(/[AB]/)) {
event.rc = true ;
} else {
app.beep() ;
event.rc = false ;
}
}Hope, this can help.
Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland
Fax: +41 1 700 20 37 or +1 815 425 6566 e-mail: mailto:[EMAIL PROTECTED] http://www.prodok.com
[ Building Bridges for Information ]
______________________
Shameless Plug:
My next conference appearances and workshops:
• Training classes in cooperation with essociates Group, in Toronto, ON, Canada, March 9 - 12, 2004; more information at http://www.essociatesgroup.com/AdvancedAcrobatForms.htm and http://www.essociatesgroup.com/MultipleLanguageFormsInAcrobat.htm
• And, as always, available for on-site workshops/tutorials/consulting.
_________________________
Are there any Good Samaritans that can help me out with a simple Javascript
?
I need a simple code to prevent a user from entering anything other than "A"
or "B" in a text field.
To change your subscription: http://www.pdfzone.com/discussions/lists-pdfforms.html
