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

Required fields based on previous selections

New Here ,
Oct 30, 2020 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

145

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
community guidelines
Community Expert ,
Oct 30, 2020 Oct 30, 2020

Copy link to clipboard

Copied

The second line overrides the setting of the first line. 

Votes

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
community guidelines
New Here ,
Oct 30, 2020 Oct 30, 2020

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Expert ,
Oct 31, 2020 Oct 31, 2020

Copy link to clipboard

Copied

LATEST

You can use this:

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

Votes

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
community guidelines