Skip to content

Commit d19e4c7

Browse files
committed
Update jquery.custom.forms-0.5.js
add disabled class when element is disabled
1 parent 23f4b24 commit d19e4c7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

jquery.custom.forms-0.5.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,15 @@
186186

187187
createFakeElement: function(element, type) {
188188
var value = (type == 'select') ? $(element).children('option[value="'+element.get(0).value+'"]').html() : '';
189-
return $('<span class="'+ this.setClass(type) +'">'+ value +'</span>');
189+
var disabled = element.attr('disabled') !== undefined
190+
191+
var fakeElement = $('<span class="'+ this.setClass(type) +'">'+ value +'</span>');
192+
193+
if (element.attr('disabled') !== undefined) {
194+
fakeElement.addClass(this.setClass('disabled'));
195+
}
196+
197+
return fakeElement;
190198
},
191199

192200
isRadio: function(element) {

0 commit comments

Comments
 (0)