Highlighted

Required fields based on previous selections

New Here ,
Oct 30, 2020

Copy link to clipboard

Copied

I have a form I am creating where we ask for them to chose between 3 options.

There are 2 of those 3 seelctions that would need to trigger a text box beneith to be required.

I have the 3 selections setup as radial buttons already and attempted to use the following code but it would only wok for 1 of the 2 not either or.

 

event.target.required=(this.getField("Requests").valueAsString=="Login Project");

event.target.required=(this.getField("Requests").valueAsString=="Create and Login");

 

Using this within the Custom Calculation Script, would only trigger the required field from Create and Login but not Login Project.

 

Hope this all makes sense.

TOPICS
PDF forms

Views

26

Likes

Translate

Translate

Report

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

Required fields based on previous selections

New Here ,
Oct 30, 2020

Copy link to clipboard

Copied

I have a form I am creating where we ask for them to chose between 3 options.

There are 2 of those 3 seelctions that would need to trigger a text box beneith to be required.

I have the 3 selections setup as radial buttons already and attempted to use the following code but it would only wok for 1 of the 2 not either or.

 

event.target.required=(this.getField("Requests").valueAsString=="Login Project");

event.target.required=(this.getField("Requests").valueAsString=="Create and Login");

 

Using this within the Custom Calculation Script, would only trigger the required field from Create and Login but not Login Project.

 

Hope this all makes sense.

TOPICS
PDF forms

Views

27

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 30, 2020 0
Adobe Community Professional ,
Oct 30, 2020

Copy link to clipboard

Copied

The second line overrides the setting of the first line. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 30, 2020 0
New Here ,
Oct 30, 2020

Copy link to clipboard

Copied

Is there a way to make it an either/or thing? Without it overriding one another?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 30, 2020 0
Adobe Community Professional ,
Oct 31, 2020

Copy link to clipboard

Copied

You can use this:

event.target.required = this.getField("Requests").valueAsString == "Login Project"
|| this.getField("Requests").valueAsString == "Create and Login";

Likes

Translate

Translate

Report

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