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

Making Fields Required Based on Entry in a Field

New Here ,
Mar 07, 2023 Mar 07, 2023

Copy link to clipboard

Copied

I want to make it where if some enters text into one field, it makes a handful of fields following it required. If no text is entered, the fields remain not required.

TOPICS
Acrobat SDK and JavaScript

Views

164

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 ,
Mar 07, 2023 Mar 07, 2023

Copy link to clipboard

Copied

LATEST

You can use this code as the custom Validation script of the main field:

 

var otherFields = ["Text1", "Text2", "Text3"]; // replace with actual field names
for (var i in otherFields) {
	this.getField(otherFields[i]).required = (event.value!="");
}

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