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

how to set one of 3 textfields to be mandatory

Guest
Apr 18, 2016 Apr 18, 2016

In a pdf form I need one of 3 telephone fields to be mandatory so that I get at least one telepnone number in the form

TOPICS
Acrobat SDK and JavaScript , Windows
207
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 ,
Apr 19, 2016 Apr 19, 2016
LATEST

That would require using a script to perform the entire validation and submit process, which is a bit of an overkill...

One alternative it to set up a required (hidden) text field that will concatenate the values of all 3 fields, so that if they are all empty it will be empty as well as the validation process will fail.

If the fields are named Phone1, Phone2 and Phone3 you can use this code as the custom calculation code of that field:

event.value = this.getField("Phone1").valueAsString + this.getField("Phone2").valueAsString + this.getField("Phone3").valueAsString;

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