$this->add('text', 'msg_title', ts('Message Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_MessageTemplate', 'msg_title'), TRUE);
$options = array(ts('Compose On-screen'), ts('Upload Document'));
- $this->addRadio('file_type', ts('Source'), $options);
+ $element = $this->addRadio('file_type', ts('Source'), $options);
+ if ($this->_id) {
+ $element->freeze();
+ }
$this->addElement('file', "file_id", ts('Upload Document'), 'size=30 maxlength=60');
$this->addUploadElement("file_id");
mimeType = $('a.delete-attachment').data('mimetype');
}
- showHideUpload($("input[id$='_file_type']:checked").val());
+ showHideUpload($("input[id$='_file_type']").val());
$("input[id$='_file_type']").on('click', function(){
showHideUpload(this.value);
});
$('.crm-document-accordion').hide();
$('#document_file').on('change', function() {
if (this.value) {
- $('.crm-html_email-accordion, .crm-document-accordion').toggle(false);
+ $('.crm-html_email-accordion, .crm-document-accordion').hide();
+ cj('#document_type').closest('tr').hide();
$('#template').val('');
}
});