DNN 7 adding "Choose File" button in RadAsyncUpload control
Add an Answer
Your question has been submitted and is awaiting moderation.
I am reporting this content because…
Thank you for reporting this content, moderators have been notified of your submission.
I am upgrading a module to DNN 7 (7.0.5). I am using RadAsyncUpload (I have a Telerik license). When the page does a postback it adds a new button that says "Choose File" next to the teleric submit button. If I refresh the page it goes away.
Looking at the code in dnn.jquery.js it looks that this is inserting the button. How do I prevent this.
(function ($) {
$.fn.dnnFileInput = function () {
return this.each(function () {
var $ctrl = $(this);
if (this.wrapper)
return;
//if this.wrapper is undefined, then we check if parent node is a wrapper
if (this.parentNode && this.parentNode.tagName.toLowerCase() == 'span' && this.parentNode.className == 'dnnInputFileWrapper') {
return;
}
this.wrapper = $("<span class='dnnInputFileWrapper'></span>");
$ctrl.wrap(this.wrapper);
var text = $ctrl.data('text');
text = text || 'Choose File';
var btn = $("<span class='dnnSecondaryAction'>" + text + "</span>");
btn.insertBefore($ctrl);
$ctrl.change(function () {
var val = $(this).val();
if (val != '') {
var lastIdx = val.lastIndexOf('\\') + 1;
val = val.substring(lastIdx, val.length);
} else {
val = text;
}
$(this).prev().html(val);
});
});
};
})(jQuery);
How to I prevent this from happening in my module?