<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: using VSTA in InfoPath in a browser form</title><link>https://www.infopathdev.com:443/forums/thread/33509.aspx</link><pubDate>Fri, 24 Oct 2008 17:56:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33509</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33509.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=33509</wfw:commentRss><description>&lt;p&gt;Yes, I would imagine you could use conditional formatting to hide the text box when /my:myFields/my:ErrorMsg is blank.&lt;/p&gt;</description></item><item><title>Re: using VSTA in InfoPath in a browser form</title><link>https://www.infopathdev.com:443/forums/thread/33467.aspx</link><pubDate>Thu, 23 Oct 2008 22:35:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33467</guid><dc:creator>jrudolph</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33467.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=33467</wfw:commentRss><description>I dont know if this will actually answer your question, but have you tried simply using rules in conjunction with your text box?</description></item><item><title>using VSTA in InfoPath in a browser form</title><link>https://www.infopathdev.com:443/forums/thread/33428.aspx</link><pubDate>Thu, 23 Oct 2008 17:29:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33428</guid><dc:creator>bradyw</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33428.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=33428</wfw:commentRss><description>&lt;p&gt;All I have added code in the load event of my infopath form, when an error occured i did have messagebox but you can not use that on a browser based form, &lt;/p&gt;
&lt;p&gt;*************** the questions is that if you add the text box to the form if will show up regardless if you have an error or not.Is there&amp;nbsp; a way to hide and show the text box based on if there is an error or not?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i found this article:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Displaying error message for browser-enabled form template&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Edit 8:34 PM by MarkRoberts&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;ChrisP123: The code examples do assume that you&amp;#39;re opening the form in the InfoPath client. As you&amp;#39;ve discovered, System.Windows.Forms.MessageBox() is not supported for forms that can open in the browser. To display an error message in a web-based form on InfoPath Forms Services, you&amp;#39;d need to display the message in-line in the form itself. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;One way to do that, is to add a text field to the Main data source, eg named &amp;quot;ErrorMsg&amp;quot;, drag that as a Text Box control on to the form, and then use code like the following in the try/catch block to write the error message to the ErrorMsg field:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;catch (Exception ex){&amp;nbsp;&amp;nbsp; XmlNamespaceManager ns = this.NamespaceManager;&lt;br /&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;br /&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:ErrorMsg&amp;quot;, ns).SetValue(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;The following error occurred: &amp;quot; + ex.Message);&lt;br /&gt;&amp;nbsp;&amp;nbsp; throw;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>