Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Searching for an effective date range and restrictions, where only can have a range in the past, adding the <strong>constraints</strong> max with echoing the date in this format <code>Y-m-d</code>, I manage to edit it like this, hopes this help. </p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>dojo.require("dijit.form.DateTextBox");</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/resources/dojo.css"&gt; &lt;link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dijit/themes/tundra/tundra.css" media="screen" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js" data-dojo-config="isDebug: true, parseOnLoad: true"&gt;&lt;/script&gt; &lt;body class="tundra"&gt; &lt;form&gt; &lt;label for="fromDate"&gt;From:&lt;/label&gt; &lt;input id="fromDate" type="text" name="fromDate" data-dojo-type="dijit.form.DateTextBox" data-dojo-props="onChange: function() {dijit.byId('toDate').constraints.min = arguments[0];}, required: true, constraints:{max:'&lt;?PHP echo date(" Y-m-d "); ?&gt;'} " /&gt; &lt;label for="toDate"&gt;To:&lt;/label&gt; &lt;input id="toDate" type="text" name="toDate" data-dojo-type="dijit.form.DateTextBox" data-dojo-props="onChange: function() {dijit.byId('fromDate').constraints.min = arguments[0];}, required: true, constraints:{max:'&lt;?PHP echo date(" Y-m-d "); ?&gt;'} " /&gt; &lt;button onclick="dijit.byId('fromDate').reset(); dijit.byId('toDate').reset();" type="reset"&gt;reset&lt;/button&gt; &lt;button type=""&gt;Generate&lt;/button&gt; &lt;/form&gt;</code></pre> </div> </div> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload