• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Interactiv PDF (Formular field) problem

Explorer ,
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

547

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

Community Expert , 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);
	}
}

@+

Votes

Translate

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

Copy link to clipboard

Copied

A 9 in the arbitrary mask allows every number.

Votes

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
Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

yes, but why except 9?

Votes

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.

Votes

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

Votes

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

Votes

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.

Votes

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
Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Oh so great! Thanks a lot!

Votes

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

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

@+

Votes

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
Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

LATEST

great! It works! Thanks so much

Votes

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