title: Grails: disable g:datePicker
body: <p>How does one disable g:datePicker when the page loads? </p>
  
  <p>The code is supposed disable the datePicker when a variable (isCurrent) is true.</p>
  
  <pre><code>&lt;g:if test="${!isCurrent}"&gt;
                      &lt;g:datePicker name="endDate" precision="month" value="${projectInstance?.endDate}" years="${2005..2050}"/&gt;
                  &lt;/g:if&gt;
                  &lt;g:else&gt;
                      &lt;g:datePicker name="endDate" precision="month" value="${projectInstance?.endDate}" years="${2005..2050}" disabled="disabled"/&gt;
                  &lt;/g:else&gt;
  </code></pre>