Form Field Help! If they answer YES then require a comment

New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

Hello, I am new to this form creating and having to create a simple form with all yes & no responses, however after creating the drop down fields I get lost on the java script ( way over my head) I want to create a if/then statement in Acrobat. If they answer yes, additional comments must me answered.  If no, then no additional questions are needed.

TOPICS
PDF forms

Views

73

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Jul 31, 2020

Copy link to clipboard

Copied

So you want to make a field hidden or visible based on the selection in the drop-down, basically?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
darreola AUTHOR
New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

Hi, It does not have to be hidden, Working on a questionnaire set up  with yes / no answers on a drop downs . I wanted to require people to comment if they selected Yes on drop down. Sorry I am so new to this,  the creating part of the form was pretty user friendly for starters like me, but the java script  is a bit overwhelming after reading / seeing some tutorials, 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Jul 31, 2020

Copy link to clipboard

Copied

Then you need to define what "require" means. In what way should it be required? How should it be enforced?

Is the file being submitted back to you? If so, you can set the field's "required" property to prevent it from being submitted.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
darreola AUTHOR
New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

By require I meant,  If they answer yes on any of the questions, they will need to answer why they said yes in a  additional comment field that I need to set as required to fill out. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Jul 31, 2020

Copy link to clipboard

Copied

That doesn't answer my question, so let me rephrase: What should happen if they don't fill in that additional comments field?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
darreola AUTHOR
New Here ,
Aug 03, 2020

Copy link to clipboard

Copied

sorry, if they dont fill out tha additional field it will not let them submit the form. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
try67 LATEST
Most Valuable Participant ,
Aug 03, 2020

Copy link to clipboard

Copied

OK. In order to do that you need to set the field as required.

As the custom calculation script of the comments field you can enter something like this:

 

event.target.readonly = (this.getField("Dropdown1").valueAsString=="Yes");

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more