Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>With the new, HTML5-conform attribute <code>data-dojo-type</code> introduced in Dojo 1.6, the way how widget attributes are parsed has changed as well (to validate in HTML5 too). Widget-specific attributes are now in an HTML attribute called <code>data-dojo-props</code>, in a JSON-style syntax.</p> <p>To make your example work again, either put the <code>onChange</code> (and <code>required</code>) in <code>data-dojo-props</code> (note that you have to wrap a function around it):</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;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" /&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" /&gt;</code></pre> </div> </div> </p> <p>Or you use the old <code>dojoType</code> instead of <code>data-dojo-type</code>, then the <code>onChange</code> attribute would be parsed. Note that it would not be HTML5-conform, but in my opinion more elegant.</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