File select prob in IE

Thread is closed for posting
4 posts, 1 answers
  1. Charles Kline
    Charles Kline avatar
    4 posts
    Member since:
    May 2010

    Posted 27 May 2010 Link to this post

    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
  2. Answer
    Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 27 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Charles Kline
    Charles Kline avatar
    4 posts
    Member since:
    May 2010

    Posted 27 May 2010 Link to this post

    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
  5. Charles Kline
    Charles Kline avatar
    4 posts
    Member since:
    May 2010

    Posted 27 May 2010 Link to this post

    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!
Back to Top