I used the tutorial [url=http://www.acrobatusers.com/tutorials/2006/change_another_field]'Changing Another Field with Combo Box (Drop Down) Selection'[/url] to set up a 2 option combo box to allow users to select either 'Standard Price' or New York Price' pricing structures. The combo box is set to when a choice is made it changes the values of several invisible text fields to the required prices that are used in calculating total pricing for whatever number of units.
My problem arises from the fact that the combo box will change the text field values to the New York pricing with no problems, but will not change them back to normal pricing when Standard is then selected from the combo box. The default value of the text fields is the Standard price, so the current setup can change from Standard to New York, but not back to standard.
Here is the document script i used, modified directly from the above tutorial;
var PricingData = { "New York Price":{ "Screens": "105", "ScreensCMOnly": "75", "ScreensII": "115", "CSafe": "20.30", "NonCsafe": "23.10", "MCT": "98", "MCTCards": "17.20", "1CT": "51.10", "IR": "18", "IIController": "28", "CCReceiver": "14", "CCServer": "171.50", "1stHour": "120", "AddlHour": "80", "Mileage": "0.95", "Standard Price":{ "Screens": "87.50", "ScreensCMOnly": "50", "ScreensII": "97.50", "CSafe": "8.75", "NonCsafe": "10.50", "MCT": "60", "MCTCards": "15", "1CT": "21", "IR": "16", "IIController": "26", "CCReceiver": "12", "CCServer": "150", "1stHour": "65", "AddlHour": "65", "Mileage": "0.95" }}}; function SetFieldValues(cPricingType) { this.getField("DefaultScreenTechVal").value = PricingData[cPricingType]["Screens"]; this.getField("12CMOnlyTechVal").value = PricingData[cPricingType]["ScreensCMOnly"]; this.getField("12wPTechVal").value = PricingData[cPricingType]["ScreensII"]; this.getField("CsafeTechVal").value = PricingData[cPricingType]["CSafe"]; this.getField("NonCsafeTechVal").value = PricingData[cPricingType]["NonCsafe"]; this.getField("MCTTechVal").value = PricingData[cPricingType]["MCT"]; this.getField("MCTCardsTechVal").value = PricingData[cPricingType]["MCTCards"]; this.getField("1ChTTechVal").value = PricingData[cPricingType]["1CT"]; this.getField("IRTechVal").value = PricingData[cPricingType]["IR"]; this.getField("IITechVal").value = PricingData[cPricingType]["IIController"]; this.getField("CCReceiverTechVal").value = PricingData[cPricingType]["CCReceiver"]; this.getField("CCServerTechVal").value = PricingData[cPricingType]["CCServer"]; this.getField("1stHrTechVal").value = PricingData[cPricingType]["1stHour"]; this.getField("AddlHrTechVal").value = PricingData[cPricingType]["AddlHour"]; this.getField("MileageTechVal").value = PricingData[cPricingType]["Mileage"]; }
And here is the combo box script (also from the tutorial);
if( event.willCommit ) { if(event.value == "") this.resetForm(["DefaultScreenTechVal","12CMOnlyTechVal","12wPTechVal","CsafeTechVal","NonCsafeTechVal","MCTTechVal","MCTCardsTechVal","1ChTTechVal","IRTechVal","IITechVal","CCReceiverTechVal","CCServerTechVal","1stHrTechVal","AddlHrTechVal","MileageTechVal"]); else SetFieldValues(event.value); }
I receive the following when I use your code and select the "Standard Price" or the empty selection:
37:Document-Level:PricingData
PricingData[cPricingType] has no properties
37:Document-Level:PricingData
PricingData[cPricingType] has no properties
39:Document-Level:PricingData
PricingData[cPricingType] has no properties
39:Document-Level:PricingData
PricingData[cPricingType] has no properties
39:Document-Level:PricingData
PricingData[cPricingType] has no properties
39:Document-Level:PricingData
missing } after property list
18:
PricingData[cPricingType] has no properties
37:Document-Level:PricingData
PricingData[cPricingType] has no properties
37:Document-Level:PricingData
The filled in items do not clear when the empty item is selected becuase one can not have an empty option for a combo box, it is either a space or some text.
George Kaiser