This is a two part problem, data binding and accessing data sources. The following addresses problem one, data binding. Build an XML instance to express the sales tax rates by state. I did a partial list of states and added 'TaxRates.xml' as the preview data source.
<?xml version="1.0"?>
<form1>
<subform1>
<taxRates>
<State id="" salesTax=""/>
<State id="AK" salesTax="0.00"/>
<State id="AL" salesTax="4.00"/>
<State id="AR" salesTax="6.00"/>
<State id="AZ" salesTax="5.60"/>
<State id="CA" salesTax="8.25"/>
</taxRates>
</subform1>
</form1>
Built an XML schema to describe the XML instance and add it as a data connection. My schema is embedded in the attached form. The schema 'TaxRates.xsd' is attached also.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xfadata="http://www.xfa.org/schema/xfa-data/1.0/">
<xsd:element name="form1">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="subform1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="subform1">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="taxRates"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="taxRates">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="State" maxOccurs="51">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="salesTax" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Use dynamic binding to bind the state drop-down list to the data connection. In the 'state' data binding specify the Item Text as the attribute 'id' and Item Value as the attribute 'salesTax'.
![Untitled.png Untitled.png](/t5/image/serverpage/image-id/1463iA0E306114F9B8D78/image-size/large?v=v2&px=999)
In the exit event of 'state' add JavaScript to assign the raw value of 'state' to the raw value of 'taxRate'.
// form1.page1.subform1.state::exit - (JavaScript, client)
form1.page1.subform1.taxRate.rawValue = this.rawValue;
Steve