Copy link to clipboard
Copied
I have a problem with an interactive PDF.
Only the corresponding number (no other) may appear in the fields (3x3). Fields 1-8 work. But not the 9. Anyone know why?
Hi,
With this script, you can type several 9 in the box!
You can only allow one 9 number in the box with this custom keystroke script:
if(!event.willCommit) {
event.rc=/^9$/.test(event.value+event.change)==true || event.change=="";
}
or this one if you wish a message:
if(!event.willCommit) {
if (!(/^9$/.test(event.value+event.change)==true || event.change=="")) {
event.rc=false;
app.alert("You only must type a 9 in this box.",3);
}
}
@+
Copy link to clipboard
Copied
A 9 in the arbitrary mask allows every number.
Copy link to clipboard
Copied
yes, but why except 9?
Copy link to clipboard
Copied
There has the 9 a special meaning.
Copy link to clipboard
Copied
Use this as 'Custom keystroke script' in field for number 9:
var x = /^9*$/.test(event.change);
if(!x)
app.alert('The value entered does not match the format of the field = "9"');
event.rc = /^9*$/.test(event.change);
Copy link to clipboard
Copied
many thanks
okey, but i dont know, where i put this java...can you explain? Or do it in the PDF ;)?
Copy link to clipboard
Copied
In the 'Format' tab, select 'Custom' and where it says 'Custom keystroke script' click on 'Edit' and paste script inside.
Copy link to clipboard
Copied
Oh so great! Thanks a lot!
Copy link to clipboard
Copied
Hi,
With this script, you can type several 9 in the box!
You can only allow one 9 number in the box with this custom keystroke script:
if(!event.willCommit) {
event.rc=/^9$/.test(event.value+event.change)==true || event.change=="";
}
or this one if you wish a message:
if(!event.willCommit) {
if (!(/^9$/.test(event.value+event.change)==true || event.change=="")) {
event.rc=false;
app.alert("You only must type a 9 in this box.",3);
}
}
@+
Copy link to clipboard
Copied
great! It works! Thanks so much