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

Adobe Acrobat Form : Adding 5 fields and allow "-" in any field

Engaged ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

 

I want to add Five Fields (numeric) and also allow user to enter "-" (dash sign) if no value is present instead of 0.


but when i put "-" in any field it returns NaN.


Following is my script :

var n1 = Number(this.getField("Text1").valueAsString);
var n2 = Number(this.getField("Text2").valueAsString);
var n3 = Number(this.getField("Text3").valueAsString);
var n4 = Number(this.getField("Text4").valueAsString);
var n5 = Number(this.getField("Text5").valueAsString);

event.value = n1+n2+n3+n4+n5;


Thanks in advance

 

 

[moved by moderator to Acrobat from Community Help.]

 

TOPICS
Acrobat SDK and JavaScript

Views

325

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 ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

LATEST

Duplicate posting.

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