parmarmayur9090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

dpSetDisabled(false) fail with jquery > 1.6 #341

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi

dpSetDisabled(false) actually do the opposite with jquery > 1.6:
input field (:text) will be disabled and not enabled.

line 650:
if ($e.is(':text')) {
 $e.attr('disabled', s ? 'disabled' : '');
}

This change could do it:
if ($e.is(':text')) {
 if ($e.prop){
   $e.prop('disabled', s);
 } else {
   $e.attr('disabled', s ? 'disabled' : '');
 }
}

regards
Jesper

Original issue reported on code.google.com by jesper.s...@gmail.com on 13 Mar 2012 at 2:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The problem is that when setting 'disabled' to any value, even an empty string, 
the disabled attribute is set on the element.
I would suggest the following:

if ($e.is(':text')) {
    if (s) {
        $e.attr('disabled', 'disabled');
    } else {
        $e.removeAttr('disabled');
    }
}

Regards,

Huberto

Original comment by Huberto....@gmail.com on 18 Apr 2012 at 10:54