// ==================================== // FORM // ==================================== var leForm = { init: function(){ if($('form').length > 0){ $('form').each(function(i,el){ leForm.setReadonly(el); }); } }, // form is the form element setReadonly: function(form){ if(!$(form).hasClass('readonly')){ return false; } $(form).find('input[type=text], textarea').prop('readonly',true); $(form).find('input[type=checkbox], select').prop('disabled',true); $(form).find('.removeAttachmentButton').remove(); }, } $(document).ready(function(){ leForm.init(); });