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

add popup message to currant script

Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

hi, i'm using bellow script with drop down field. what i want to do is, if select "SGD" in drop down, fields "EX" value should be empty. if select any other value in drop down, need to popup message "Please fill exchange rate". ps help me to edit bellow script. thanks in advance. thanks..

var sNewSel = event.value;

switch (sNewSel) {

  case "SGD":

    this.getField("EX").value = "";

}

TOPICS
Acrobat SDK and JavaScript , Windows

Views

360

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

correct answers 1 Correct answer

Community Expert , Mar 20, 2018 Mar 20, 2018

Add this if-condition before the alert:

if (this.getField("EX").valueAsString=="")

     app.alert("Please fill exchange rate");

Votes

Translate

Translate
Community Expert ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

Add this to the switch statement:

default: app.alert("Please fill exchange rate");

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
Participant ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

hi, thanks a lot. can u pls give me the compete code inserting your code. thanks in advance.

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 ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

I forgot to mention that you also need to add a "break" command... Here's the full code:

var sNewSel = event.value;

switch (sNewSel) {

    case "SGD":

        this.getField("EX").value = "";

        break;

    default:

        app.alert("Please fill exchange rate");

}

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
Participant ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

thanks a lot & it's working perfectly.. i just want add another condition into it so pls help me.

if select anything other than "SGD" & field "EX" is empty then only need to popup that message.

if fields "EX" already available values then no need that popup massage. thanks..

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 ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

Add this if-condition before the alert:

if (this.getField("EX").valueAsString=="")

     app.alert("Please fill exchange rate");

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
Participant ,
Mar 20, 2018 Mar 20, 2018

Copy link to clipboard

Copied

LATEST

thanks a lot & it's work perfectly..

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