Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

app.alert asks question twice

$
0
0

I have a combobox that will ask a question anytime an entry is chosen. The problem is that when something is chosen, it asks the question twice. It reports the answer from the first time it asks the question, so I don't know and I can't figure out why it asks the question another time. I tried moving the question somewhere else in the script with no luck. This is my code:

 

var cMsg = "Is this a Premium?"

var nRtn = app.alert(cMsg,1,3,"Premium");

 

if (!event.willCommit)

{

if(nRtn == 4)

{ // A Yes Answer

this.getField("Premium1").value = 1;

}

else if(nRtn == 3)

{ // A No Answer

this.getField("Premium1").value = 0;

}

else

{

}

 

{    if (event.changeEx != " ")

        {

 

if(this.getField("Date1_mm").value=="");

this.getField("Date1_mm").value = util.printd ("mm", new Date());

 

if(this.getField("Date1_yyyy").value=="");

this.getField("Date1_yyyy").value = util.printd ("yyyy", new Date());

 

this.getField("Date1_mm").required = false;

this.getField("Date1_dd").required = false;

this.getField("Date1_yyyy").required = false;

 

} else {

 

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

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

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

 

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

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

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

 

            }

        }

 

 

}


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>