I have a drop list that is being populated from a database. I also have a record in the database that holds a value (the hidden text value in the drop list) that could indicate which item in the droplist should be selected. Since the value in the database is not always up-to-date I want to initialize the drop list with this value, but allow the user to make an alternate selection if it is not correct. Is it possible to initialize a drop list?
Following FormCalc code may help you. rawValue porperty sets the default selection. For the following example 'Xyz' gets displayed after loading all the values. And user can change the selection form there. Hope this helps.
Of course, this assumes that the InitialDropDownListSelection field's value is the same type of value which is assigned to each individual item in your drop down list.
I've attached a sample form (zipped along with a data file) which contains a drop down list initialized from records in an XML Data File. The default selection in this drop down list is based on the value of an invisible text field which is bound to a specific data node in the same XML Data File. While this isn't working from a data base, the principal is the same. If you open the form in Acrobat (instead of previewing it from Designer 7.1), remember to import the data into the form after you've opened it.