RadUpload for ASP.NET AJAX

RadControls for ASP.NET AJAX

Usually, the submit button which sends the file to the server is placed outside the upload div.

This example show how to place the submit button inside the upload div, reside in the button area (next to the Add and Delete buttons) and have the look of the other upload buttons.

CopyASPX
<telerik:radupload id="RadUpload1" runat="server" skin="Web20" />
CopyJavaScript
        function pageLoad() {
            var upload = $find("<%= RadUpload1.ClientID %>");
            var uploadDiv = upload.get_element();

            var input = document.createElement("input");
            input.type = "submit";
            input.className = "ruButton";
            input.value = "Submit";
            input.id = input.name = upload.getID("submit");
            if (document.getElementById(input.id) != null)
                return;

            //the UL element of the upload
            var ul = uploadDiv.getElementsByTagName("UL");
            //the array of all LI elements of the UL element
            var LIs = ul[0].getElementsByTagName("LI");
            //Last LI item - the button area
            var lastLi = LIs[LIs.length - 1];
            lastLi.appendChild(input);
        }

Here is the result:

Before:

Upload

After:

Upload