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

i have 3 text fields and need at least one of them to be completed in acrobat

New Here ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

var aF = ["ECONOMY TOTAL", "SP SVC"];

var sf = this.getField("EXPRESS TOTAL");

for (var i = 0; i < aF.length; i++) {

    var v = this.getField(aF).value;

    if (v !== "") {

        this.getField("last 4 digits").required

        break;

    }

}

I have 3 text boxes all numerical values only, EXPRESS TOTAL, ECONOMY TOTAL & SP SVC, I would like at least one of these text boxes to be completed with a value greater than 0. If one box has information then the other 2 textboxes are not required to be completed

I started with the above as a custom calculation script for each of the text boxes but am unsure if i am doing this correctly

Also should the form when opened have these text boxes as required ticked at source and only when one of these 3 text boxes is completed with a value greater than 0  the required state for the other 2 textboxes will be removed

TOPICS
Acrobat SDK and JavaScript

Views

195

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 ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

LATEST

This is already answered in the Forms forum.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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