<?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: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35145.aspx</link><pubDate>Tue, 02 Dec 2008 13:47:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35145</guid><dc:creator>Raajkumar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35145.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35145</wfw:commentRss><description>Hi all,&lt;br /&gt;&lt;br /&gt;

There is problem when I activated this to a Sharepoint.&lt;br /&gt;&lt;br /&gt;

I have made this form to be browser enabled&lt;br /&gt;&lt;br /&gt;

The validation not working in sharepoint

Please Help Me!!</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35140.aspx</link><pubDate>Tue, 02 Dec 2008 13:06:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35140</guid><dc:creator>Raajkumar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35140.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35140</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;

it is working now&lt;br /&gt;&lt;br /&gt;

Thanks to  every one who have helped me in sorting this problem!&lt;br /&gt;</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35138.aspx</link><pubDate>Tue, 02 Dec 2008 12:31:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35138</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35138.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35138</wfw:commentRss><description>&lt;p&gt;It looks like this line might be the problem:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (strStartDate != &amp;quot;&amp;quot; || StrEndDate != &amp;quot;&amp;quot;)&lt;/p&gt;
&lt;p&gt;you should perform the comparison if both are valid dates, not if&amp;nbsp;just one is, so it should be an &amp;amp;&amp;amp; operation.&amp;nbsp; Also, your code could be a bit more robust.&amp;nbsp; Give this a try:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; pathNav = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.MainDataSource.CreateNavigator();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; strStartDate = pathNav.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:TimeSheet/my:Dates/my:start&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value.ToString();&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; strEndDate = pathNav.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:TimeSheet/my:Dates/my:End&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value.ToString();&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.Operation == &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlOperation&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.ValueChange)&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; startDateObj, endDateObj;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.TryParse(strStartDate, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;out&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; startDateObj) &amp;amp;&amp;amp; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.TryParse(strEndDate, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;out&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; endDateObj))&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (startDateObj.Year != endDateObj.Year || startDateObj.Month != endDateObj.Month)&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;{&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;e.ReportError(e.Site, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Please select the same month&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;}&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;}&lt;br /&gt;&lt;font color="#2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;}&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35137.aspx</link><pubDate>Tue, 02 Dec 2008 12:24:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35137</guid><dc:creator>Raajkumar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35137.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35137</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;

The code works if I am going through debugging mode but if i go through by clicking &lt;b&gt;preview&lt;/b&gt; in infopath IDE then it is showing error</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35135.aspx</link><pubDate>Tue, 02 Dec 2008 12:12:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35135</guid><dc:creator>Rajitha</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35135.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35135</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hi,&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Your code is working correctly for me.&lt;/font&gt;&lt;/p&gt;&lt;span style="mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Put condition&lt;span style="COLOR:blue;"&gt; &lt;/span&gt;like this.&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;if&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; (iSDate != iEDate)&lt;/span&gt;&lt;span style="mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Are you using the same code which you have given?&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;I think at the substring indexes you went wrong. Once check.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35124.aspx</link><pubDate>Tue, 02 Dec 2008 10:21:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35124</guid><dc:creator>Raajkumar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35124.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35124</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;

Thanks for you reply.&lt;br /&gt;&lt;br /&gt; 
I tried but according to the solution, both the dates should be same like 12/2/2008 == 12/2/2008 if it is like 12/2/2008 and 12/30/2008 it is showing error&lt;br /&gt;&lt;br /&gt;
I need to check only the year and month not the date</description></item><item><title>Re: Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35122.aspx</link><pubDate>Tue, 02 Dec 2008 10:09:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35122</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35122.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35122</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can directly validate using the data validation. No need to use the code.&lt;/p&gt;
&lt;p&gt;1. Go to the date picker properties.&lt;/p&gt;
&lt;p&gt;2. Click on data validation.&lt;/p&gt;
&lt;p&gt;3. Click Add.&lt;/p&gt;
&lt;p&gt;4. First date picker is not blank and&lt;/p&gt;
&lt;p&gt;5. Second date picker is not blank and&lt;/p&gt;
&lt;p&gt;6. Select the first date picker field in first drop down, not equal to in second drop down, second date picker field in third drop down. And enter the screen tip and message which you want to show to the user. &lt;/p&gt;
&lt;p&gt;7. Click ok.&lt;/p&gt;</description></item><item><title>Validating StartDate and EndDate</title><link>https://www.infopathdev.com:443/forums/thread/35118.aspx</link><pubDate>Tue, 02 Dec 2008 09:29:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35118</guid><dc:creator>Raajkumar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35118.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=35118</wfw:commentRss><description>Hi,

I have created an infopath form in which I placed two datepicker control.&lt;br /&gt;&lt;br /&gt;

I need to validate like both the startdate month &amp;amp; year ,enddate month&amp;amp;year should be same&lt;br /&gt;&lt;br /&gt;

How can do this? I tried using the C# code behind like this,&lt;br /&gt;&lt;br /&gt;

  public void End_Validating(object sender, XmlValidatingEventArgs e)&lt;br /&gt;&lt;br /&gt;
        {&lt;br /&gt;&lt;br /&gt;

            XPathNavigator pathNav = this.MainDataSource.CreateNavigator();&lt;br /&gt;
            string strStartDate = pathNav.SelectSingleNode(&amp;quot;/my:TimeSheet/my:Dates/my:start&amp;quot;, NamespaceManager).Value.ToString();&lt;br /&gt;
            string StrEndDate = pathNav.SelectSingleNode(&amp;quot;/my:TimeSheet/my:Dates/my:End&amp;quot;, NamespaceManager).Value.ToString();&lt;br /&gt;
            if (e.Operation == XmlOperation.ValueChange)&lt;br /&gt;
            {&lt;br /&gt;
                if (strStartDate != &amp;quot;&amp;quot; || StrEndDate != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    iSDate = Convert.ToInt32(strStartDate.Substring(5, 2).ToString());&lt;br /&gt;
                    iEDate = Convert.ToInt32(StrEndDate.Substring(5, 2).ToString());&lt;br /&gt;
                    if (iSDate  iEDate)&lt;br /&gt;
                    {&lt;br /&gt;
                        e.ReportError(e.Site, true, &amp;quot;Please select the same month&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;

but it is showing error ,&lt;br /&gt;&lt;br /&gt;

System.ArgumentOutOfRangeException&lt;br /&gt;
startIndex cannot be larger than length of string.&lt;br /&gt;
Parameter name: startIndex&lt;br /&gt;
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)&lt;br /&gt;
   at TimeSheet.FormCode.End_Validating(Object sender, XmlValidatingEventArgs e)&lt;br /&gt;
   at Microsoft.Office.InfoPath.Internal.XmlEventHost.GenericProxy(Object genericDelegate, DataDOMEvent dataDOMEvent, InfoPathEvents type)&lt;br /&gt;
   at Microsoft.Office.InfoPath.Internal.XmlEventHost.ValidatingProxy(DataDOMEvent dataDOMEvent)&lt;br /&gt;
   at Microsoft.Office.Interop.InfoPath.SemiTrust._DataDOMEventSink_SinkHelper.OnValidate(DataDOMEvent pDataDOMEvent)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

Please Help me</description></item></channel></rss>