<p>In my example below I'm using a <code>dijit.form.DateTextBox</code>:</p>

<pre><code>&lt;input type="text" name="startDate" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'MM/dd/yyyy'}"  value='&lt;c:out value="${sessionScope.adminMessageForm.startDate}"/&gt;' /&gt;
</code></pre>

<p>So for example, if the user starts to enter "asdf" into the date the field turns yellow and a popup error message appears saying <code>The value entered is not valid.</code>. Even if I remove the <code>constraints="{datePattern:'MM/dd/yyyy'}"</code> it still validates.  </p>

<p>Without going into details as to why, I would like to be able keep the dojoType and still prevent validation in particular circumstances.</p>

[{'answer_id': 15532, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 1, 'selected': False, 'text': '<p>My only suggestion is to programmatically remove the dojoType on the server-side or client-side.  It is not possible to keep the dojoType and not have it validate.  Unless you create your own type that has you logic in it.</p>\n'}, {'answer_id': 15677, 'author': 'RodeoClown', 'author_id': 943, 'author_profile': 'https://Stackoverflow.com/users/943', 'pm_score': 4, 'selected': True, 'text': '<p>Try overriding the validate method in your markup.</p>\n\n<p>This will work (just tested):</p>\n\n<pre><code>&lt;input type="text" name="startDate" dojoType="dijit.form.DateTextBox" \n  constraints="{datePattern:\'MM/dd/yyyy\'}"  \n  value=\'&lt;c:out value="${sessionScope.adminMessageForm.startDate}"/&gt;\'\n  validate=\'return true;\'\n/&gt;\n</code></pre>\n'}, {'answer_id': 59751, 'author': 'esarjeant', 'author_id': 644, 'author_profile': 'https://Stackoverflow.com/users/644', 'pm_score': 1, 'selected': False, 'text': '<p>I had a similar problem, where the ValidationTextBox met all my needs but it was necessary to disable the validation routines until after the user had first pressed Submit.</p>\n\n<p>My solution was to clone this into a ValidationConditionalTextBox with a couple new methods:</p>\n\n<pre><code>    enableValidator:function() {\n        this.validatorOn = true;\n    },\n\n    disableValidator: function() {\n        this.validatorOn = false;\n    },\n</code></pre>\n\n<p>Then -- in the validator:function() I added a single check:</p>\n\n<pre><code>        if (this.validatorOn)\n        { ... }\n</code></pre>\n\n<p>Fairly straightforward, my default value for validatorOn is false (this appears right at the top of the javascript). When my form submits, simply call enableValidator(). You can view the full JavaScript here:</p>\n\n<p><a href="http://lilawnsprinklers.com/js/dijit/form/ValidationTextBox.js" rel="nofollow noreferrer">http://lilawnsprinklers.com/js/dijit/form/ValidationTextBox.js</a></p>\n'}]
['https://Stackoverflow.com/questions/15514', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/700/']