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

Bei Auswahl einer Option im drop-dpwn menü soll die im Javascript progammierte Abfolge sofort eingeleitet werden. Bisher muss ich ein weiteres mal das drop-down menu anklicken. Kann mir jemand helfen?

New Here ,
Jun 24, 2019 Jun 24, 2019

Copy link to clipboard

Copied

Hallo,

ich habe ein drop-down menu (M1) mit z.B. Optionen 1 und 2. Bei Auswahl 1 soll textfeld n1, bei Auswahl 2 textfeld n2 bzw. visible werden.

Aktuell jedoch muss ich nach der auswahl erneut das drop-down menu anklicken damit die Programm Abfolge abläuft und die Textfelder entsprechend der Auswahl angezeigt warden. Es ware schön, wenn sofort mit Auswahl der Option die Textfelder nach Programm (javascript) angezeigt warden.

Maus taste loslassen oder drücken ändert nichts oder last sich nicht ändern.

Vielleicht kann mit jemand weiterhelfen?

Hier der code (unter Aktionen E2):

var M1=this.getField("M1").value

if(M1==1)

{

this.getField("n1").display = display.visible;

this.getField("n2").display = display.hidden;

}

else

{

if (M1==2)

{

this.getField("n2").display = display.visible;

this.getField("n1).display = display.hidden;

}

}

Beste Grüße und Danke

TOPICS
Acrobat SDK and JavaScript , Windows

Views

187

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
Community Expert ,
Jun 24, 2019 Jun 24, 2019

Copy link to clipboard

Copied

Place the code under the Validation event of the drop-down field (M1), and change this line:

var M1=this.getField("M1").value

To:

var M1=Number(event.value);

Also, make sure to tick the option to commit the selected value immediately, under the field's Properties, Options tab.

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 ,
Jun 25, 2019 Jun 25, 2019

Copy link to clipboard

Copied

Thank you for your fast response. I changes the code according to your recommendations and it works 🙂

So far I have not considered the validation field for placing code. Just for me to understand and learn, why it works when the code is placed there? What is the difference to the regular action field where I placed the code?

Best regards and thanks again

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
Community Expert ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

What does you mean with "Aktionen E2" ?

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 ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

Hi,

this E2 has to be M1, a mistake sorry. Actually I meant that the code is placed under properties, Aktionen field of the drop-down menu M1.

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
Community Expert ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

But what exact action are you using?

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 ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

I had chosen "JavaScript ausführen".

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
Community Expert ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

What I mean is, what trigger are you using...

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 ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

release the Mouse button

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
Community Expert ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

You should move it to the Validation event.

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 ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

LATEST

ok, thank you for your support 🙂

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