Interactiv PDF (Formular field) problem

New Here ,
Sep 17, 2022 Sep 17, 2022

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?

See here download: Interaktives PDF 

TOPICS
JavaScript

Views

63

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Sep 17, 2022 Sep 17, 2022

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);
	}
}

@+

Likes

Translate

Translate
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

A 9 in the arbitrary mask allows every number.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

yes, but why except 9?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

There has the 9 a special meaning.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

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);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2022 Sep 17, 2022

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 ;)?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Oh so great! Thanks a lot!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 17, 2022 Sep 17, 2022

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);
	}
}

@+

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

LATEST

great! It works! Thanks so much

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines