<?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: Obtaining the value of controls</title><link>https://www.infopathdev.com:443/forums/thread/14871.aspx</link><pubDate>Tue, 07 Nov 2006 23:53:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14871</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14871.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14871</wfw:commentRss><description>First, the if statements should read: if(strValue == "false"), etc.&lt;br /&gt;&lt;br /&gt;Note that you are assigning the value "false" (single equal sign) instead of comparing (double equal sign).&lt;br /&gt;&lt;br /&gt;Second, strValue is the .text value already and that property probably doesn't even exist on the variable.&lt;br /&gt;&lt;br /&gt;Since this code is not running in the OnLoad event handler, you should not be using the .IsDefault property. Instead you should use the SwitchViews() function.</description></item><item><title>Obtaining the value of controls</title><link>https://www.infopathdev.com:443/forums/thread/12975.aspx</link><pubDate>Tue, 07 Nov 2006 14:10:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12975</guid><dc:creator>Jackie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12975.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12975</wfw:commentRss><description>Can anyone help? I have put in place a control that forces the user to click on a checkbox. Depending on the value with depend on the view the user sees. The code is below: &lt;br /&gt;&lt;br /&gt;var strValue &lt;br /&gt;strValue = XDocument.DOM.selectSingleNode"//my:Change/my:ChangeSubmit").text &lt;br /&gt;&lt;br /&gt;XDocument.UI.Alert(strValue) &lt;br /&gt;&lt;br /&gt;if (strValue.text = "false") &lt;br /&gt;XDocument.ViewInfos("Main View").IsDefault = true; &lt;br /&gt;&lt;br /&gt;if (strValue.text = "true") &lt;br /&gt;XDocument.ViewInfos("TUG View").IsDefault = true; &lt;br /&gt;&lt;br /&gt;The value (strValue) is correct and is giving me a true or false text value via the alert. The problem I am having is that the "If" statement is not recognising the value therefore the line of code that changes the view does not run.&lt;br /&gt;&lt;br /&gt;Any suggestions greatly appreciated. &lt;br /&gt;&lt;br /&gt;Many thanks &lt;br /&gt;Jackie</description></item></channel></rss>