<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/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>Problem with dateField and Button</title><link>https://community.appian.com/discussions/f/user-interface/34400/problem-with-datefield-and-button</link><description>Hi, 
 I would like the button to be active by default if no date is selected or if a date equal to or after today is selected. And at the same time, the button is disabled if an invalid date or date older than today is entered. 
 
 The problem is that</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Problem with dateField and Button</title><link>https://community.appian.com/thread/131449?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2024 16:19:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79eb6c3a-17b1-44e1-a918-7dbdf53ec76d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!buttonWidget(
  label: &amp;quot;Submit&amp;quot;,
  disabled: and(
    a!isNotNullOrEmpty(ri!dueDate),
    ri!dueDate &amp;lt; today()
  ),
  submit: true()
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with dateField and Button</title><link>https://community.appian.com/thread/131447?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2024 15:29:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:40fce22d-b91c-421d-8045-f30ac63a5436</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;&amp;nbsp;Hello&amp;nbsp;&lt;a href="/members/carlosd4386"&gt;Carlos de Vega&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;a simple null check before evaluating your disable condition would suffice your requirement.&lt;/p&gt;
&lt;p&gt;But I would say keeping it disabled when it is blank also is a good option, unless you want to accept a null value.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          disabled: if(
            a!isNullOrEmpty(ri!dueDate),
            {},
            ri!dueDate &amp;lt; today()
          ),
          submit: true
        )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>