Skip to main content
Known Participant
February 17, 2023
Question

Required Fields

  • February 17, 2023
  • 2 replies
  • 3949 views

I have an Excel sheet with formulas that I converted to a PDF.  In the Excel sheet I used the formula '=IF(NOT(ISBLANK(A5)), "Please select the size", "").  The first field on the PDF has a dropdown box for quantity (0-10).  If a user selects a quantity, other than zero, they are required to fill out the size and length fields.  How do I make the size field and the length field required if a quantity higher than zero is selected?

This topic has been closed for replies.

2 replies

Known Participant
February 21, 2023

am i able to share this file with someone directly and not post to the community?  i still dont have it working.

try67
Community Expert
Community Expert
February 17, 2023

As the custom Validation script of the drop-down you can enter something like this (adjust the field name as necessary, of course):

 

this.getField("size").required = (event.value!="0");

this.getField("length").required = (event.value!="0");

Known Participant
February 17, 2023

Please forgive my ignorance.  If the dropdown field is named Quantity where would I put this in the script so that size and then length are mandatory fields?

try67
Community Expert
Community Expert
February 17, 2023

Nowhere. You only need to specify the names of the other fields in this code.