<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Switch view based off content of text box</title><link>https://www.infopathdev.com:443/forums/thread/26475.aspx</link><pubDate>Thu, 14 Feb 2008 19:14:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26475</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26475.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26475</wfw:commentRss><description>&lt;p&gt;I found out that using code two switch views is not available using OnAfterChange or OnBeforeChange events.&amp;nbsp; Though still looking for a work around.&amp;nbsp; I think I will just have to add another step in the forms.&lt;/p&gt;</description></item><item><title>Switch view based off content of text box</title><link>https://www.infopathdev.com:443/forums/thread/26403.aspx</link><pubDate>Tue, 12 Feb 2008 18:52:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26403</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26403.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26403</wfw:commentRss><description>&lt;p&gt;I do not think it is possible, but just want to check.&amp;nbsp; I have a text box(txtBox1) and based on what is typed in that text box, I want it to change to another view(VIEW2).&amp;nbsp; Is it possible to do this with code?&lt;/p&gt;
&lt;p&gt;I would like to use somethign like this on the on after chage event for the text box:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;If&lt;/font&gt;&lt;font size="2"&gt; thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:txtBox1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;0&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;thisXDocument.View.SwitchView(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;VIEW2&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;I got it to work, but only if I used the above code in a button rather than in the on text change event.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any suggestions? or am I stuck with a button?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>