Skip to main content
April 19, 2016
Question

how to set one of 3 textfields to be mandatory

  • April 19, 2016
  • 1 reply
  • 230 views

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

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 19, 2016

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;