Skip navigation
Lily@Reliable
Currently Being Moderated

drop down box

Jun 23, 2012 7:24 AM

Tags: #acrobat-forms #acrobat_pro_x

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

I used the article Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1

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

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points