<?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: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14798.aspx</link><pubDate>Wed, 27 Sep 2006 00:31:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14798</guid><dc:creator>cornik99</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14798.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14798</wfw:commentRss><description>I have another issue with if else on opening another form which I started on new thread .open another form using if else condition'.  So, please help me again.  Thanks.</description></item><item><title>Re: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14797.aspx</link><pubDate>Wed, 27 Sep 2006 00:09:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14797</guid><dc:creator>cornik99</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14797.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14797</wfw:commentRss><description>Thank you all for your help but the one that worked was Greg's solution #3 (For node being either not present or blank).  Greg, you're great!  Sorry, I was sick so I wasn't able to respond right away.</description></item><item><title>Re: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14796.aspx</link><pubDate>Thu, 21 Sep 2006 17:10:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14796</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14796.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14796</wfw:commentRss><description>Checking for null is correct assuming that you expect the node to be physically not present in the DOM at times. If you want to know whether it is blank... that's different.&lt;br /&gt;&lt;br /&gt;Also, you don't need to reselect the field multiple times as you've already stored it in a variable.&lt;br /&gt;&lt;br /&gt;Try:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. For node to be physically not present:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;var sourcePhDirect = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_direct");&lt;br /&gt;var sourceExt = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_ext");&lt;br /&gt;&lt;br /&gt;if(sourcePhDirect != null)&lt;br /&gt;    destPhone.text = sourcePhDirect.text;&lt;br /&gt;else&lt;br /&gt;    destPhone.text = "(555)-201-8000 x" + sourceExt.text;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. For node value being blank:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;var sourcePhDirect = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_direct");&lt;br /&gt;var sourceExt = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_ext");&lt;br /&gt;&lt;br /&gt;if(sourcePhDirect.text != "")&lt;br /&gt;    destPhone.text = sourcePhDirect.text;&lt;br /&gt;else&lt;br /&gt;    destPhone.text = "(555)-201-8000 x" + sourceExt.text;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. For node being either not present or blank:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;var sourcePhDirect = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_direct");&lt;br /&gt;var sourceExt = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_ext");&lt;br /&gt;&lt;br /&gt;if(sourcePhDirect.text != null &amp;&amp; sourcePhDirect.text != "")&lt;br /&gt;    destPhone.text = sourcePhDirect.text;&lt;br /&gt;else&lt;br /&gt;    destPhone.text = "(555)-201-8000 x" + sourceExt.text;&lt;br /&gt;</description></item><item><title>Re: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14795.aspx</link><pubDate>Thu, 21 Sep 2006 07:35:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14795</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14795.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14795</wfw:commentRss><description>And please let us know what resolved your issue.</description></item><item><title>Re: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14794.aspx</link><pubDate>Thu, 21 Sep 2006 07:26:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14794</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14794.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14794</wfw:commentRss><description>Hi Cornik,&lt;br /&gt;&lt;br /&gt;Can you try for one more condition,&lt;br /&gt;&lt;br /&gt;if (sourcePhDirect != undefined)</description></item><item><title>Re: What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/14793.aspx</link><pubDate>Wed, 20 Sep 2006 07:09:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14793</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14793.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14793</wfw:commentRss><description>Can you try (sourcePhDirect != "") instead of if (sourcePhDirect != null).</description></item><item><title>What's wrong with this if else statement?</title><link>https://www.infopathdev.com:443/forums/thread/12948.aspx</link><pubDate>Sat, 16 Sep 2006 00:09:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12948</guid><dc:creator>cornik99</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12948.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12948</wfw:commentRss><description>Codes run okay when sourcePhDirect &amp;lt;&amp;gt; null but when it's blank the value of sourceExt is being returned as null even though it has a value.  This for the business card order form where the phone value is fill-in from another form using the direct line number but if an employee doesn't have one then it's the company main number plus the extension.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var sourcePhDirect = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_direct");&lt;br /&gt;var sourceExt = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_ext");&lt;br /&gt;&lt;br /&gt;if (sourcePhDirect != null)&lt;br /&gt;	destPhone.text = XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_direct").text;&lt;br /&gt;else&lt;br /&gt;	destPhone.text = "(555)-201-8000 x" + XDocument.DOM.selectSingleNode("//my:myFields/my:telephone_ext").text;	&lt;br /&gt;</description></item></channel></rss>