This is a migrated thread and some comments may be shown as answers.

File select prob in IE

3 Answers 50 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Charles Kline
Top achievements
Rank 1
Charles Kline asked on 27 May 2010, 02:45 PM
I have an upload form that is working great in every browser I test, except for IE. The issue is that I am not using the "Select" button, but relying on the ability to "select" by clicking in the file upload field. On IE it behaves like a textbox, and just gives me a place to type text.

I see this behavior also on the demo forms, but all of those also have a select button.

Version: 2009.3.1324.20

Here is my code:

<form id="form1" runat="server"
    <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
    <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" /> 
    <telerik:RadUpload ID="RadUpload1" runat="server" onclientadded="increaseFileInputWidth" EnableEmbeddedSkins="false" EnableFileInputSkinning="true" Localization-Clear=""  ControlObjectsVisibility="ClearButtons" /> 
    <asp:ImageButton ID="btnUpload" runat="server" ImageUrl="Images/Buttons/106x26UploadPDF.png" /> 
    </form> 

Thanks,
Charles

3 Answers, 1 is accepted

Sort by
0
Accepted
Kamen Bundev
Telerik team
answered on 27 May 2010, 04:40 PM
Hello Charles,

This is the default behavior of normal input type file in IE browsers, so RadUpload is copying it. You can easily override that though by using this simple javascript:
function pageLoad() {
    if ($telerik.isIE)
        $telerik.$('.ruFileInput, .ruFakeInput').live('mousedown', function () {
            $telerik.$('.ruFileInput', this.parentNode)[0].click();
        });
}


Best wishes,
Kamen Bundev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Charles Kline
Top achievements
Rank 1
answered on 27 May 2010, 07:20 PM
I have implemented this code and it did fix the issue I was having, but it has introduced another issue. Once I click the input and get the dialog to browse for file. When I choose the file and click Open, the browse window closes and then immediately re-opens. I'm not sure what is causing this. Again, this is only in IE 8.

Thanks,
Charles
0
Charles Kline
Top achievements
Rank 1
answered on 27 May 2010, 07:36 PM
I got it...

 function pageLoad() { 
        if ($telerik.isIE) 
            $telerik.$('.ruFileInput, .ruFakeInput').live('mousedown'function () { 
                $telerik.$('.ruFileInput'this.parentNode)[0].click(); 
                return false
            }); 
        } 

Had to return false from the function.

Thanks!
Tags
Upload (Obsolete)
Asked by
Charles Kline
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Charles Kline
Top achievements
Rank 1
Share this question
or