Reputation: 257
i am using the date picker in an input field the input field is disabled, but when I click on it, the date picker opens
any idea?
im disableing it with this
document.getElementById('id').readOnly = true;
Upvotes: 0
Views: 545
Reputation: 1417
The following example should work for you:
<div id="txtDate" jsId="txtDate" data-dojo-type="dijit.form.DateTextBox"></div>
require(['dojo/parser', 'dijit/form/DateTextBox']);
dojo.ready(function() {
dijit.byId('txtDate').set('readonly', 'readonly');
dijit.byId('txtDate').set('disabled', 'disabled');
});
Upvotes: 1
Reputation: 67505
Try also :
$("#id").attr('readonly', 'readonly');
OR :
$("#id").attr('disabled', 'disabled');
Upvotes: 0