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

Making Fields Required Based on Entry in a Field

New Here ,
Mar 07, 2023 Mar 07, 2023

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
467
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
Community Expert ,
Mar 07, 2023 Mar 07, 2023
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!="");
}
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