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

comb

Explorer ,
Mar 30, 2016 Mar 30, 2016

is it possible to see the numbers with zero in front like 00 01 02 03 (comb with 2 characters)

TOPICS
Acrobat SDK and JavaScript , Windows
610
Translate
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 , Mar 30, 2016 Mar 30, 2016

Yes, but then you have to define the field's Format as None.

Translate
Community Expert ,
Mar 30, 2016 Mar 30, 2016

Yes, but then you have to define the field's Format as None.

Translate
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 ,
Mar 30, 2016 Mar 30, 2016

i made this

var t1 = Number(this.getField("Textfield221").value);

if (event.value>=1 && event.value<=98 && t1>=1 && t1<=7) this.getField("08").setFocus();var t1 = Number(this.getField("Textfield221").value);

if (event.value=="00" && t2=="0") this.getField("Textfield231").setFocus();

and as you told me i  choose format category None

and it works

Thanks

Translate
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
LEGEND ,
Mar 30, 2016 Mar 30, 2016

Use either a format type of arbitrary mask (e.g., 99) or you could create a custom keystroke/format JavaScript if the arbitrary mask option doesn't behave exactly as you want.

Translate
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
LEGEND ,
Mar 30, 2016 Mar 30, 2016

Create the form field.

Appearance add border of choice.

Options select "Comb" set size to 2.

Format custom Format Script:

event.value = util.printf("%,102.0f", event.value);

Custom Keystroke script:

if(event.willCommit == false) {

event.rc = isNaN(event.change) == false;

}

Validation:

if(isNaN(event.value) == true) app.alert("Please enter a numeric value", 1, 0);

Close.

Test the field in Preview.

Translate
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 ,
Mar 30, 2016 Mar 30, 2016

hello i follow all your format steps and i run this this custom validation script

if(event.value=="0")this.getField("Textfield221").setFocus();if(event.value>"0")this.getField("Textfield215").setFocus();if(isNaN(event.value) == true) app.alert("Please enter a numeric value", 1, 0);

it works when i type on "0" but then it is strange that i can not clear it.Always 00 apear.

Thanks

Translate
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
LEGEND ,
Mar 31, 2016 Mar 31, 2016
LATEST

I do not have that problem as long as I delete one or both digits.

Translate
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