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

92

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
community guidelines
Adobe Community Professional ,
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;
}

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

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
community guidelines
Adobe Community Professional ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

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

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
community guidelines
New Here ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Oh u r right, thank you so much!

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
community guidelines
Adobe Community Professional ,
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.

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
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?

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
community guidelines
Adobe Community Professional ,
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.

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