Please,
I am trying to collect an email address in a field. I have the regualr expression for that done, but now am working within the quirks of Acrobat Forms. I have created a keystroke script, but can not find a way to allow backspace, disallow spaces and special characters from the form user.
Here is one of the many tries, witth the part I can not make work at the end...
Could someone show me how to make the [/b] function?
console.clear();
console.show();
console.println("event.willCommit:" + event.willCommit)
var re3 = /^[\w]$/
var re4 = /^[/b]$/ //backspace ? no work
var re5 = /^\t$/ // tab ? no work
if (event.willCommit == false){
if (re3.test(event.change) == false) {
event.rc = false
console.println(util.printf("did not pass re3"))
}
}
if (event.willCommit == false){
if ((event.change) == " ") {
console.println(util.printf("found SPACE "))
event.rc = false
}
}
if (event.willCommit == false){
if ((event.change) == "@") {
console.println(util.printf("found @"))
event.rc = true
}
}
if (event.willCommit == false){
if (re4.test(event.change.keycode) == true) {
console.println(util.printf("to allow backspace"))
event.rc = true
}
}
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com