Javascript drop down menu selection calls a function
Hi all,
I'm in over my head once again. Currently trying to learn JavaScript and trying to run before I can walk. Hey ho.
How do I go about calling one of three different functions based on the user's selection from a drop-down menu?
I can only seem to get it to do A4. And it also runs the function when I click cancel (which it shouldn't do).
Any help, as always, is very much appreciated.
var myList = ["A4", "US Letter", "A4 & US Letter"];
var myDialog = app.dialogs.add({name:"PDF Export", canCancel:true});
with (myDialog )
with (dialogColumns.add())
with(borderPanels.add())
{
staticTexts.add ({staticLabel:"Select:"});
var myDropSelection = dropdowns.add({stringList:myList, selectedIndex:2});
}
if(myDialog.show() == true){
alert (myList [myDropSelection.selectedIndex])
myDialog.destroy();
}
if([selectedIndex = 0]){
exportA4();
}
if([selectedIndex = 1]){
exportUS();
}
if([selectedIndex = 2]){
exportBoth();
}
function exportA4() {//code here}
function exportUS() {//code here}
function exportBoth() {//code here}
