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

Required Fields

New Here ,
Feb 17, 2023 Feb 17, 2023

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?

TOPICS
How to , PDF forms
3.7K
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 ,
Feb 17, 2023 Feb 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");

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
New Here ,
Feb 17, 2023 Feb 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?

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 ,
Feb 17, 2023 Feb 17, 2023

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

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
New Here ,
Feb 17, 2023 Feb 17, 2023

Where in the code?  I don't know where to put quantity in the code.

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
New Here ,
Feb 17, 2023 Feb 17, 2023

jennifer28461489ef3d_0-1676658336159.png

 

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 ,
Feb 17, 2023 Feb 17, 2023

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?

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
New Here ,
Feb 17, 2023 Feb 17, 2023

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.

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 ,
Feb 17, 2023 Feb 17, 2023

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.

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 ,
Feb 17, 2023 Feb 17, 2023

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.

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
New Here ,
Feb 21, 2023 Feb 21, 2023

am I able to send you the file directly without posting in the community?

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 ,
Feb 21, 2023 Feb 21, 2023

You can email it to [try6767 at gmail.com].

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
New Here ,
Feb 21, 2023 Feb 21, 2023
LATEST

Thank you.  I sent it over

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
New Here ,
Feb 21, 2023 Feb 21, 2023

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

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