Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 92756

Re: Combo Box Properties - List of Items

$
0
0

Now the problem becomes entering the description of the item and then setting the export value for that choice to the SKU code. Using this approach would eliminate the need for additional code to assign the SKU value to a field based on the item value selected.

 

So I would have a document level array like:

 

// array of item descriptions and SKU values;
var aItemsValues = new Array(
["",""],
["Item 1", 12345],
["Item 2", 67890],
["Item 3",54321],
["Item 4", "09876"]
);

function PopulateArray(cName, aArray){
try{
// set doropdown box items and export values;
this.getField(cName).setItems(aItemsValues);
return true;
} catch(e) {
app.alert("Error populating field " + cName, 0, 1);
return false;
}
}

PopulateArray("Dropdown1", aItemsValues);

 

Then a custom keystroke script like:

 

if(event.willCommit == false) {

this.getField("Text1").value = event.changeEx;

}

 

And as each item is select in field DropDown1 the SKU code appears in field "Text1". Note that the "Commit immediately" option needs to be set.


Viewing all articles
Browse latest Browse all 92756

Trending Articles



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