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

add popup message to currant script

Participant ,
Mar 19, 2018 Mar 19, 2018

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
641
Translate
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");

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

Add this to the switch statement:

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

Translate
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

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

Translate
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

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");

}

Translate
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

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

Translate
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

Add this if-condition before the alert:

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

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

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

thanks a lot & it's work perfectly..

Translate
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