<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/93990.aspx</link><pubDate>Wed, 30 Oct 2013 17:04:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93990</guid><dc:creator>ehaze</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93990.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=93990</wfw:commentRss><description>is there a way to access XDocument.Errors.Count without using code?

my hope is to set a fields default value to XDocument.Errors.Count.</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/44270.aspx</link><pubDate>Mon, 13 Jul 2009 23:58:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44270</guid><dc:creator>krishna</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44270.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=44270</wfw:commentRss><description>&lt;p&gt;I am not able to pass text to the button using this approach. If anyone using this approach, please let me know.&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21585.aspx</link><pubDate>Tue, 10 Jul 2007 08:22:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21585</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21585.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21585</wfw:commentRss><description>Good work. Glad I could help. Cheers</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21566.aspx</link><pubDate>Mon, 09 Jul 2007 19:35:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21566</guid><dc:creator>Sharksfan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21566.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21566</wfw:commentRss><description>&lt;p&gt;Hi Nukkamatti,&lt;/p&gt;&lt;p&gt;Vielen dank f&amp;uuml;r&amp;nbsp;die&amp;nbsp;Hilfe.&amp;nbsp; It took some work getting the code just right, but I finally got it.&amp;nbsp; Here is how it turned out:&lt;/p&gt;&lt;p&gt;function CTRL613_5::OnClick(eventObj) &lt;/p&gt;&lt;p&gt;{ &lt;/p&gt;&lt;p&gt;var error; error = XDocument.Errors.Count; if(error != 0) XDocument.UI.Alert(&amp;quot;You have not filled all requried fields&amp;quot;); &lt;/p&gt;&lt;p&gt;if(error == 0) XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:Error&amp;quot;).text = &amp;quot;enabled&amp;quot;; &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;I created a new button named &amp;quot;Check for errors&amp;quot; this button is visible as long as the &amp;quot;dummy&amp;quot; field is &lt;em&gt;disabled&lt;/em&gt; then once error count = = 0 then the dummy field = &lt;em&gt;enabled&lt;/em&gt;, the Check for Errors button (it is within a section) is hidden and then the&amp;nbsp;section containing the Submit button is then visible.&amp;nbsp; :)&lt;/p&gt;&lt;p&gt;Tch&amp;uuml;&amp;szlig;&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21540.aspx</link><pubDate>Mon, 09 Jul 2007 06:15:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21540</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21540.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21540</wfw:commentRss><description>&lt;p&gt;Hi, set the default value of your dummy field to &amp;quot;disabled&amp;quot;. Add conditional formatting to your button which says &amp;quot;If dummy is equal to disabled&amp;quot; then disable this control. now in your function ErrorChecking you say if(error == 0) XDocuemnt.DOM.selectSingleNode(my:myFields/my:dummy).text = enabled; this should work I guess. Just let me know if you have any further&amp;nbsp;problems.&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21513.aspx</link><pubDate>Fri, 06 Jul 2007 16:06:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21513</guid><dc:creator>Sharksfan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21513.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21513</wfw:commentRss><description>&lt;p&gt;Thanks nukkamatti&lt;/p&gt;&lt;p&gt;I understand how to create the dummy field, but when you say &amp;quot;disabled&amp;quot; do you mean &amp;quot;read-only&amp;quot; or something else?&amp;nbsp; Also, when I set&amp;nbsp;the dummy field switch to &amp;quot;enabled&amp;quot; if errors = 0 how do I do that, via rules or using code?&amp;nbsp; If using code it would be something like;&lt;/p&gt;&lt;p&gt;&lt;em&gt;function ErrorChecking()&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;{&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;var DummyField = XDoucment.DOM.selectSingleNode(&amp;quot;//my:txtDummyField&amp;quot;);&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;var error; error = XDocument.Errors.Count;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;if(error != 0) XDocument.UI.Alert(&amp;quot;You have not filled all requried fields&amp;quot;) DummyField = &amp;quot;disabled&amp;quot;;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;if(error= 0) DummyField = &amp;quot;enabled&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Excuse my ignorance, but I am still learning so I don&amp;#39;t know the proper syntax for how to set the DummyField to be disabled or enabled.&amp;nbsp; A little help would be great there.&lt;/p&gt;&lt;p&gt;Thanks again.&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21433.aspx</link><pubDate>Wed, 04 Jul 2007 05:37:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21433</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21433.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21433</wfw:commentRss><description>Add a dummy field to your datasource and set its default value to disabled. in the operation where you check if error != 0 set the value of the dummy field to enable if error = 0. set&amp;nbsp; conditional formatting&amp;nbsp;on you button and disable it if dummy is equal to disabled.&amp;nbsp;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21428.aspx</link><pubDate>Tue, 03 Jul 2007 22:09:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21428</guid><dc:creator>Sharksfan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21428.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21428</wfw:commentRss><description>&lt;p&gt;Nukkamati&amp;#39;s code worked great.&amp;nbsp; I got the message pop-up just like I wanted.&lt;/p&gt;&lt;p&gt;Does anyone now know how I can use the &lt;em&gt;error = XDocument.Errors.Count; if(error != 0)&lt;/em&gt; and Conditional Formatting to also disable the Submit button until the error count = 0?&lt;/p&gt;&lt;p&gt;The reason I am asking is becuase I will want to change views on Submit and I don&amp;#39;t want to changes views unless the form&amp;nbsp;is validated and&amp;nbsp;Submitted.&amp;nbsp; I tried creating a text field to capture the error count and then have the Submit Button conditional formatting look at that field, but I couldn&amp;#39;t get it to work.&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/21289.aspx</link><pubDate>Wed, 27 Jun 2007 07:26:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21289</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21289.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=21289</wfw:commentRss><description>Yes there is a way to do this easily. From within you button OnClick event use something like the following: var error; error = XDocument.Errors.Count; if(error != 0) XDocument.UI.Alert(&amp;quot;You have not filled all requried fields&amp;quot;); else.... Errors.Count won&amp;#39;t be zero until all your fields which are set to mandatory or have data validation on it are filled correctly. Hope this helps, sorry for the late reply.</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/20108.aspx</link><pubDate>Tue, 22 May 2007 21:59:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20108</guid><dc:creator>Sharksfan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20108.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=20108</wfw:commentRss><description>&lt;p&gt;Thanks nukkumatti.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Anyway to do this so that I don&amp;#39;t&amp;nbsp;have to have the Submit button look at every required field independently to ensure it is completed?&amp;nbsp; My thought was to not even have the section containing the Submit button visible until all validation errors are cleared, but is there a way to do this easily?&amp;nbsp; Again witout looking at each required field independently?&lt;/p&gt;</description></item><item><title>Re: Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/20092.aspx</link><pubDate>Tue, 22 May 2007 06:48:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20092</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20092.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=20092</wfw:commentRss><description>&lt;p&gt;In my oppinion the best practice for these situations always is to not enable the submit button unless all other required actions are performed or mandatory fields are filled. Set conditional formatting on your button and check there if this is the case and then enable the button.&lt;/p&gt;&lt;p&gt;Would this help in your scenario as well.&lt;/p&gt;</description></item><item><title>Validate form on Submit</title><link>https://www.infopathdev.com:443/forums/thread/20088.aspx</link><pubDate>Mon, 21 May 2007 20:19:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20088</guid><dc:creator>Sharksfan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20088.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=20088</wfw:commentRss><description>&lt;p&gt;I am trying to validate a form when a user clicks on the Submit button.&amp;nbsp; I studied this post &lt;a href="http://www.infopathdev.com/forums/thread/11721.aspx"&gt;http://www.infopathdev.com/forums/thread/11721.aspx&lt;/a&gt;&amp;nbsp;but the script did not work for me.&amp;nbsp; Let me first explain the Rules that run when a user clicks on the Submit button.&lt;/p&gt;&lt;p&gt;My Rules run as follows on Submit:&lt;/p&gt;&lt;ol start="1"&gt;&lt;li&gt;Change a boolean expression box to True from False.&amp;nbsp; Once this expression box reflects True then the section containing the Submit button is hidden so that it is no longer visible within the submitted form and email attachment to prevent users from &amp;quot;accidently&amp;quot; re-submitting when reviewing the attachment in email.&lt;/li&gt;&lt;li&gt;Submit form to SharePoint library.&amp;nbsp; This library is used to keep a copy of submitted forms as a back up strategy in case emails are lost.&amp;nbsp; &lt;em&gt;(autosave is deselected as a form option so that incomplete or manually closed&amp;nbsp;forms are not saved to the library)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Submit form to email.&lt;/li&gt;&lt;li&gt;Close form.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The difficulty I am having is that when a user clicks on the Submit button and there are validation errors he/she receives two messages depending on the action taken, but for whatever reason the users are ignoring or not reading the error messages and just closing the form manually;&lt;/p&gt;&lt;ol start="1"&gt;&lt;li&gt;&lt;em&gt;Some rules were not applied&amp;nbsp; &lt;/em&gt;if the user opens the dialoge box then it tells them there are validation errors, but when a user clicks on OK then the dialoge box goes away as designed.&amp;nbsp; At this point the first Rule I have above now hides the section containing the Submit button since it was already clicked by the user.&lt;/li&gt;&lt;li&gt;If the user then tries to re-submit using the Submit button on the toolbar he/she is given the following error message, &lt;em&gt;InfoPath cannot submit the form becuase it contains validation errors.&amp;nbsp; Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values).&lt;/em&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;When the user ignores these messages and closes the form manually then nothing is submitted, but they think a request has been submitted and they ask why no email has shown up....&amp;quot;There must be an issue with the request form becuase the email request was never received.&amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp; **I roll my eyes**&lt;/p&gt;&lt;p&gt;Any ideas on how to &amp;quot;outsmart&amp;quot; the users and force them to submit a completed form or if they manually close the form give them a dialoge box message telling them that nothing has been submitted?&amp;nbsp; I thought I had my bases covered her, but I guess not.&amp;nbsp; Some ideas would be welcome.&lt;/p&gt;&lt;p&gt;Maybe I just need smarter users&amp;nbsp; *lol*&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; Quite frustrating really.&lt;/p&gt;</description></item></channel></rss>