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

Einblenden von Textfeldern

New Here ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Hallo, ich habe folgendes Problem:

Ich habe ein Dropdown-Feld mit 2 Auswahlmöglichkeiten.

Wenn die eine Möglichkeit angwählt wurde, soll ein Kontrollkästchen und 2 Textfelder eingeblendet werden,

wenn die andere Möglichkeit ausgewählt wurde, sollen mehrere andere Kontrollkästchen und Textfelder eingeblendet werden.

Ist das machbar und wenn ja wie?

 

Danke

TOPICS
Create PDFs , Edit and convert PDFs

Views

498

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Yes, using a custom validation script.

The basic code is something like this:

 

if (event.value=="Option 1") {
	this.getField("Text1").display = display.visible;
	this.getField("Text2").display = display.hidden;
	this.getField("Text2").value = "";
} else if (event.value=="Option 2") {
	this.getField("Text1").display = display.hidden;
	this.getField("Text1").value = "";
	this.getField("Text2").display = display.visible;
}

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Ok, thank you so much for you answer, but i did not get it.

May you please help me again?

Dropdown1 = Approval of

--> Option 1

Dropdown1 = Deviation of

--> Option 2

 

see below

if (event.value=="Option 1") {
	this.getField("Text1").display = display.visible;
	this.getField("Check Box1").display = display.visible;
	this.getField("Text2").display = display.hidden;
	this.getField("Check Box2").display = display.hidden;
           this.getField("Text3").display = display.hidden;
           this.getField("Check Box3").display = display.hidden;
           this.getField("Text4").display = display.hidden;
           this.getField("Check Box4").display = display.hidden;
           this.getField("Text5").display = display.hidden;
           this.getField("Check Box5").display = display.hidden;
	this.getField("Text2").value = "";
} else if (event.value=="Option 2") {
           this.getField("Text1").display = display.hidden;
           this.getField("Check Box1").display = display.hidden;
           this.getField("Text2").display = display.visible;
           this.getField("Check Box2").display = display.visible;
           this.getField("Text3").display = display.visible;
           this.getField("Check Box3").display = display.visible;
           this.getField("Text4").display = display.visible;
           this.getField("Check Box4").display = display.visible;
           this.getField("Text5").display = display.visible;
           this.getField("Check Box5").display = display.visible;
}

What is wrong?

 

Thank you

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

You doesn't use "Option 1" and "Option 2" in the dropdown.

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Oh u r right, thank you so much!

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

You have to adjust the code to reflect the actual values of the drop-down in your file.

So instead of:

if (event.value=="Option 1") {

Use:

if (event.value=="Approval of") {

 

In addition, you should enable the option to commit the selected values of the drop-downs immediately, under the Options tab in their Properties dialogs.

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 ,
Apr 27, 2022 Apr 27, 2022

Copy link to clipboard

Copied

Ok thank you! just for information - why is it essential to enable the option?

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 ,
Apr 27, 2022 Apr 27, 2022

Copy link to clipboard

Copied

LATEST

Otherwise the script will only execute when you exit the field, not at the moment you change the selection in it.

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