<?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: Disable "cannot be blank"  condition when control is hidden</title><link>https://www.infopathdev.com:443/forums/thread/88052.aspx</link><pubDate>Fri, 15 Mar 2013 16:08:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88052</guid><dc:creator>kildonan500</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88052.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=88052</wfw:commentRss><description>&lt;p&gt;I know this reply is probably not beneficial to the OP but for anybody coming across this post having done a google search heres my simple solution to the problem of validating hidden controls, instead of setting arbitrary dates/values to hidden fields:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- Disable the &amp;quot;cannot be blank&amp;quot; checkbox on the date picker control&lt;br /&gt;- Instead add a validation rule to the date picker (or whatever other hidden field) whose condition is is the date picker cannot be blank &lt;b&gt;AND&lt;/b&gt; the boolean which toggles whether the section is visible is true, is set to true.&lt;b&gt; In this way the validation will only take place when the section is visible.&lt;/b&gt;&lt;br /&gt;- In the case of the original poster this may have meant creating a new boolean/field that is set to false by default, and turns true when the drop down value reached the selected value they desired. Then the validation would only take place when that boolean is true AND the field is blank.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In this way you can accomplish requiring validation only when the field is visible. You cant directly set a rule on whether a field is hidden or not, but you can set a boolean that matches with/corresponds with whether the field/section/control is hidden or not. You just have to make sure they are in sync.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Disable "cannot be blank"  condition when control is hidden</title><link>https://www.infopathdev.com:443/forums/thread/65682.aspx</link><pubDate>Fri, 01 Apr 2011 17:33:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65682</guid><dc:creator>dms.WebDev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65682.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65682</wfw:commentRss><description>&lt;p&gt;I solved my dilemna of refreshing.&amp;nbsp; I am quickly learning it matters what control you apply a rule to, to get the results you need.&amp;nbsp; My solution was to remove the rules I had placed on date picker 2 and move them to&amp;nbsp; dropdown list box control.&amp;nbsp; Now when a user changes their selection from drop down list, the hide/visible and corresponding dates/no dates are reflected accurately! Yeah.&lt;/p&gt;</description></item><item><title>Re: Disable "cannot be blank"  condition when control is hidden</title><link>https://www.infopathdev.com:443/forums/thread/65675.aspx</link><pubDate>Fri, 01 Apr 2011 16:54:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65675</guid><dc:creator>dms.WebDev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65675.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65675</wfw:commentRss><description>&lt;p&gt;Thanks Ernesto.&amp;nbsp; I hadn&amp;#39;t considered disabling the submit button.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I worked out a solution that is somewhat acceptable.&amp;nbsp; I went with my original plan to set date picker1 = date picker 2 if section control is hidden.&amp;nbsp;&amp;nbsp;I set 2 rules in date picker 2 control;&lt;/p&gt;
&lt;p&gt;Rule 1 if section hidden and date picker 1 date is blank, set date picker1 = date picker2&lt;/p&gt;
&lt;p&gt;Rule 2 if section visible, set date picker 1 = &amp;quot; &amp;quot; //set&amp;nbsp;date picker1 to blank so it starts out blank and data validation (&amp;quot;cannot be blank&amp;quot;)&amp;nbsp;still works - user is forced to set an original date.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This might be a question for a new forum but the only problem is if a user selects section to be visible&amp;nbsp;which requires they enter a value for date picker 1 AND they do, then changes their mind and reselects section to be hidden before submitting.&amp;nbsp; The date picker1 value doesn&amp;#39;t change back to the default date in my rule.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How do I refresh the date picker1 settings if the condition which it relies upon changes?&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Disable "cannot be blank"  condition when control is hidden</title><link>https://www.infopathdev.com:443/forums/thread/65665.aspx</link><pubDate>Fri, 01 Apr 2011 13:23:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65665</guid><dc:creator>ErnestoM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65665.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65665</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t know how or if it&amp;#39;s possible to dynamically remove/add the &amp;quot;cannot be blank&amp;quot; property, so I would recommend a different approach. Disable the submit button. So you&amp;#39;ll have two possible scenarios for the Submit button:&lt;/p&gt;&lt;p&gt;1. section is not hidden, therefore the date is required, therefore disable the Submit button until the date is entered.&lt;/p&gt;&lt;p&gt;2. section is hidden, therefore the date is not required, therefore the Submit button will be enabled.&lt;/p&gt;&lt;p&gt;Of course this means removing the &amp;quot;cannot be blank&amp;quot; requirement on the date picker control. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Disable "cannot be blank"  condition when control is hidden</title><link>https://www.infopathdev.com:443/forums/thread/65638.aspx</link><pubDate>Thu, 31 Mar 2011 18:28:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65638</guid><dc:creator>dms.WebDev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65638.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=65638</wfw:commentRss><description>&lt;p&gt;I have a date picker&amp;nbsp;control inside a section control.&amp;nbsp; The section control&amp;nbsp;is hidden when&amp;nbsp;another drop down list&amp;nbsp;control&amp;nbsp;selection equals a certain value.&amp;nbsp; I have &amp;quot;cannot be blank&amp;quot; checked on the date picker control&lt;/p&gt;
&lt;p&gt;The problem arises when the section control is hidden (and not needed).&amp;nbsp; The form won&amp;#39;t submit because the date picker control is blank which it will be when it&amp;#39;s hidden and thus not required.&amp;nbsp; Other than giving it a default date which would&amp;nbsp; deem&amp;nbsp;the data validation moot, is it possible to override this data validation if the control isn&amp;#39;t needed (is hidden)?&lt;/p&gt;
&lt;p&gt;One thing I&amp;#39;ve tried that isn&amp;#39;t working is to remove &amp;quot;cannot be blank&amp;quot; check mark,&amp;nbsp;then create a rule so that&amp;nbsp;when the section is supposed to be&amp;nbsp;hidden, set&amp;nbsp;date picker&amp;nbsp;value to a date that is acceptable. I did this by setting value of the date picker control to the value of another date picker control from the form. Data validation still stops it because the resulting value is blank. I&amp;#39;ve verifed the other&amp;nbsp;&amp;nbsp;date picker control&amp;nbsp;value is NOT blank. Both date picker data types are set to &amp;quot;Date and time (date Time)&amp;quot; and Format&amp;nbsp; is default:&amp;nbsp; Display the date like this: *3/14/2001, Display the time like this: (Do not display time).&lt;/p&gt;
&lt;p&gt;Rule example:&lt;/p&gt;
&lt;p&gt;Condition: dropdownlist = &amp;quot;Hide datepicker1 control&amp;quot;&lt;/p&gt;
&lt;p&gt;Action: Set a field&amp;#39;s value: datepicker1 = datepicker2&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Datepicker 2 is a required field and while it will be blank when datepicker1 value it called, it will be filled by the time the form submit button is clicked.&amp;nbsp; It&amp;#39;s a timing thing, isn&amp;#39;t it? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>