I'm new to scripting and don't know the lingo yet so my explanation of my problem might be difficult to understand, sorry for that.
This script is based on Thom Parkers "Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1"
Example 1 works great but I want to use an export value from the combobox instead as shown in Example 2 but that doesn't work. How do I make the export value to trigger the function?
My guess is that I have to change SetValues(event.value) but I don't know to what.
EXAMPLE 1
/*********** ComboBox1 keystroke *************/
if ( event.willCommit ) {
SetValues(event.value);
}
/**************************************************/
// Items in ComboBox1: "Talk to me"
/*********** Document-Level: SetValues *******/
var SpeakData = { "Talk to me": { speak1: "Hello world",
speak2: "and hello universe" }};
function SetValues(speakName)
{
this.getField("TextField1").value = SpeakData[speakName].speak1;
this.getField("TextField2").value = SpeakData[speakName].speak2;
}
/**************************************************/
EXAMPLE 2
/*********** ComboBox2 keystroke ************/
if ( event.willCommit ) {
SetValues(event.value);
}
/**************************************************/
// Items in ComboBox2: "Scream to me"
// "Scream to me" export value = 555
/*********** Document-Level: SetValues *******/
var ScreamData = { "555": { scream1: "Hello world",
scream2: "and hello universe" }};
function SetValues(speakName)
{
this.getField("TextField1").value = ScreamData[screamName].scream1;
this.getField("TextField2").value = ScreamData[screamName].scream2;
}
/**************************************************/
I have a combobox with one Item (MyItem). MyItem has an export value (MyExValue).
I have this script in the keystroke event.
if(event.willCommit) {
if(event.value == "MyItem") {
console.println("Item");
}
if(event.value == "MyExValue") {
console.println("Export Value")
}}
How do I make "Export Value" to show up in the console?