<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Dropdown2 persist its last selected value when Dropdown1 selection change</title><link>https://www.infopathdev.com:443/forums/thread/65089.aspx</link><pubDate>Fri, 11 Mar 2011 09:01:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65089</guid><dc:creator>chintan.desai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65089.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65089</wfw:commentRss><description>SOLUTION :)

We have to target XML content and then using xml method &amp;quot;postion() = 2&amp;quot; will set value in dropdown2 during change in dropdown1 selection.
 
Create a rule in dropdown1 properties:

In the Rule dialog box, click Add Action.
In the Action dialog box, select Set a field&amp;#39;s value from the Action drop-down list box.
In the Action dialog box, click the button behind the Field text box.
In the Select a Field or Group dialog box, click dropdown2, and then click OK.
In the Action dialog box, click the button behind the Value text box.
In the Insert Formula dialog box, click Insert Field or Group.
In the Select a Field or Group dialog box, select items (Secondary) from the Data source drop-down list box - I created Data Connection which receive fruits and vegetables (apple,carrot etc) from xml document. Here items is the field name which populate dropdown2...

In the Select a Field or Group dialog box, expand the item node, click the value node, and then click Filter Data.
In the Filter Data dialog box, click Add.
In the Specify Filter Conditions dialog box, select The expression from the first drop-down list box.
In the Specify Filter Conditions dialog box, type the following expression in the text box:
position() = 2
In the Specify Filter Conditions dialog box, click OK.
In the Filter Data dialog box, click OK.
In the Select a Field or Group dialog box, click OK.
In the Insert Formula dialog box, click OK.
In the Action dialog box, click OK. (Action dialog box value text box should look like: FruitsVegetable[position()=2. Here, FruitsVegetable is xml node which populate dropdown2)
In the Rule dialog box, click OK.
In the Rules for Opening Forms dialog box, click OK.
In the Form Options dialog box, click OK.

- Chintan</description></item><item><title>Re: Dropdown2 persist its last selected value when Dropdown1 selection change</title><link>https://www.infopathdev.com:443/forums/thread/65087.aspx</link><pubDate>Fri, 11 Mar 2011 08:28:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65087</guid><dc:creator>chintan.desai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65087.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65087</wfw:commentRss><description>Hi Hilary,

I did it but no help.

Please provide alternative.

Thanks,
Chintan</description></item><item><title>Re: Dropdown2 persist its last selected value when Dropdown1 selection change</title><link>https://www.infopathdev.com:443/forums/thread/65058.aspx</link><pubDate>Thu, 10 Mar 2011 16:12:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65058</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65058.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65058</wfw:commentRss><description>&lt;p&gt;Add a rule to the field bound to drop down 1 to set drop down 2 to blank.&lt;/p&gt;</description></item><item><title>Dropdown2 persist its last selected value when Dropdown1 selection change</title><link>https://www.infopathdev.com:443/forums/thread/65057.aspx</link><pubDate>Thu, 10 Mar 2011 15:57:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65057</guid><dc:creator>chintan.desai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65057.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65057</wfw:commentRss><description>Hi Folks,

I got the way to filter Dropdown2 values based on their respective category in Dropdown1. However, Dropdown2 persist its last selected value. 

E.g.
Dropdown1 value:
Fruits
Vegetable...

Dropdown2 value:
apple,
orange,
graps,
Carrot,
Spinach,
Brinjal...

So when user select Fruits from Dropdown1, dropdown2 will filter with apple,orange.... - user selected apple from dropdown2. when user select Vegetable from dropdown1, apple selection will remain persist along with Carrot, spinach... (please check attached screen shot). 

Note: All values are coming from Sharepoint list

Please guide.

Thanks,
Chintan</description></item></channel></rss>