gyula
gyula

Reputation: 257

how to disable the dijit date picker?

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

Answers (3)

Georg Kastenhofer
Georg Kastenhofer

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

Zakaria Acharki
Zakaria Acharki

Reputation: 67505

Try also :

$("#id").attr('readonly', 'readonly');

OR :

$("#id").attr('disabled', 'disabled');

Upvotes: 0

Amit Soni
Amit Soni

Reputation: 3316

Use as follow:-

$("#id").click(function(){
    return false;
});

Upvotes: 0

Related Questions