In the dropdown Put fruit name in the Item Field and Price in Export Value Field Like
Export Value: 20
Export Value: 30
Suppose name of dropdown is "ddFruits"
In the calculate event of TextBox put this code
event.value = this.getField("ddFruits").value
Hope this will help
If all price values, export or option values, are unique you can set the optional or export value to the price.
If you want the value to immediately update, select the "commit value" and use a custom key stroke to set the value of the text field.
If the values are all not unique then you need to use an if then else statement or switch statement to determine the selected item and then set the value of the text field on the results of the selected item.
Using the above assumptions the price field could have a script like:
event.value = 0.05;
event.value = 0.10;
event.value = 0.20;
// item not in drop down box;
event.value = "";
app.alert"Item not priced");
} // end switch fruits;
Thanks to both of you. I realize this is more complex than I thought, and that I didn't state my challenge correctly. Let me try again:
I have a number of textual items in a dropdown, let's say "Apples", "Bananas" and "Cherries".
I have an array of form fields, with different properites expressed as a numeric value, say: "Size", "Weight", and "Cost".
Each of the items in the dropdown has a value for each of the fields.
So when I select an item from the drop-down I want to populate the entire array from the values associated with the items in the drop down. Different items will fill the array of values (I actually have 28 properties in the array and about 7 items in the drop-down). The items will always have a value for all the properties in the array, but I want the user to be able to override all entries. So enter custom text in the drop-down, which would provide blank fields in the array, which could also be overwritten by the user.
Thanks in advance for your patience and help.
Thom's example is different than mine — he's using two drop-downs. I only have one, with a series of fields I want it to populate. How would i modifiy his code to omit the second drop-down?
If you can send me the file, I hope I can help you. I can solve your problem only after reviewing your code.
Ah — well, the thing is...I'm farther from a solution than I thought and I've scrapped what I had. Not very useful I'm afraid. I basically just want to populate multiple fields based on the choice in one drop-down. Didn't know it would be this hard to solve.