I am using ACrobatX pro. I am a determined novice and any help is appreciated.
Before I added any code I created my PATTERN drop-down box and my ColorSelect drop-down box. For the ColorSelect box, which is the one I want to vary depending on the Pattern selected, I have not entered any items since this is what I want the JavaScript to do after the pattern is selected.
Next I went to TASKS, OTHER TASKS, JAVASCRIPTS, DOCUMENT JAVASCRIPTS
Thom Parker – September 18, 2007 which I was referred to by GKaiseril, and added the following code which I modified slightly changing the field names and eliminating the reference to a 2nd field for price.
SetColorEntries()
var oPatternColors = {
Alamos: [
["-"],
["Champagne"],
["Winter White"]
],
Alana: [
["-"],
["Champagne"],
["Winter White"]
],
Altoona: [
["-"],
["Barley"],
["Marble"],
["Winter White"]
],
Ama: [
["-"],
["Marble"]
],
Anlu: [
["-"],
["Champagne"],
["Marble"]
]
};
function SetColorEntries() {
if(event.willCommit) {
// Get the new color list from the Pattern List
// Since the selection is being committed,
// event.value contains the pattern name
var lst = oPatternColors[event.value];
// Clear the Colors list if there are no colors for the selected pattern
if( (lst != null) && (lst.length > 0) )
this.getField("ColorSelect").setItems(lst);
else
this.getField("ColorSelect").clearItems();
}
}
Then I selected the PATTTERN drop-down box properties, and picked Actions. Under select trigger I thought Mouse exit (kind of like after update) made the most sense. For select action I picked run a Javascript. Then in the pop up window where it says Create and Edit Java Scripts I typed SetColorEntries();
The system accepted my code; however, when I try to run it, nothing happens. Well actually I get the dreaded error beep.
I am hoping someone sees what I am doing wrong, and can offer some help. This order form will be very useful to my company and once I get it, I am hoping to apply to various other order forms I am creating for our customers
Thanks
North America
Europe, Middle East and Africa
Asia Pacific