Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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");
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Nowhere. You only need to specify the names of the other fields in this code.
Copy link to clipboard
Copied
Where in the code? I don't know where to put quantity in the code.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You said it should happen if the selected value is not zero, no? That's what the script above checks.
But your Qty field doesn't look like a drop-down in the screenshot above. I don't see the arrow for selecting values. Are you sure it's not a text field? Could you share the file?
Copy link to clipboard
Copied
I am not able to share the file. The quantity field is a dropdown from 1-10. The size and length fields are also dropdowns. Yes, if someone selects a quantity, of say 2 Red and Navy jackets, they must input the size and length that is needed.
Copy link to clipboard
Copied
The script I provided will do that, if used correctly. If you can't share the file create a dummy file with just those fields and do it there.
Copy link to clipboard
Copied
Keep in mind, though, that the "required" property is only validated when the file is submitted. It has no effect when the file is saved, printed, etc., unless a special script is used to validate those required fields in those events.
Copy link to clipboard
Copied
am I able to send you the file directly without posting in the community?
Copy link to clipboard
Copied
You can email it to [try6767 at gmail.com].
Copy link to clipboard
Copied
Thank you. I sent it over
Copy link to clipboard
Copied
am i able to share this file with someone directly and not post to the community? i still dont have it working.