R
RJN
Hi
I'm using the html input type=file for uploading a file. I'm unable to
change the style of "Browse" button that appears alongside the text box.
So what I tried is I created one more input type = button , aligned the
style of this to overlap that of the "Browse" button of file upload and
using the javascript called the click event of file upload from the
click event of button.
<!-- Input type File -->
<INPUT id="filUpload" name ="filUpload" style=" LEFT: 250px; WIDTH:
500px; POSITION: absolute; TOP: 100px; HEIGHT: 22px" type="file"
runat="server">
<!--Button for triggering the file upload-->
<Div id="BrowseButton">
<input type = "button" id="btnBrowse" value="Browse..." style="Z-INDEX:
102; LEFT: 669px; WIDTH: 82px; POSITION: absolute; TOP: 120px; HEIGHT:
24px" class = "myclass" onclick = "filUpload.click();return false;"
runat="server">
</Div>
<!--Button for Submitting the page for uploading file-->
<asp:button id="btnUpload" runat="server" Width="120" Text="Upload File"
Height="24"></asp:button>
on clicking the button(id="btnBrowse") , opens the file selection
window. However on selecting the file and submitting the page by
clicking on "btnUpload" , upload doesn't happen. But if I select the
file by clicking on "filUpload" button, upload works properly.
Simulating the click event of "filUpload" only selects the file but does
not upload the file.
Any solution please?
Regards
RJN
I'm using the html input type=file for uploading a file. I'm unable to
change the style of "Browse" button that appears alongside the text box.
So what I tried is I created one more input type = button , aligned the
style of this to overlap that of the "Browse" button of file upload and
using the javascript called the click event of file upload from the
click event of button.
<!-- Input type File -->
<INPUT id="filUpload" name ="filUpload" style=" LEFT: 250px; WIDTH:
500px; POSITION: absolute; TOP: 100px; HEIGHT: 22px" type="file"
runat="server">
<!--Button for triggering the file upload-->
<Div id="BrowseButton">
<input type = "button" id="btnBrowse" value="Browse..." style="Z-INDEX:
102; LEFT: 669px; WIDTH: 82px; POSITION: absolute; TOP: 120px; HEIGHT:
24px" class = "myclass" onclick = "filUpload.click();return false;"
runat="server">
</Div>
<!--Button for Submitting the page for uploading file-->
<asp:button id="btnUpload" runat="server" Width="120" Text="Upload File"
Height="24"></asp:button>
on clicking the button(id="btnBrowse") , opens the file selection
window. However on selecting the file and submitting the page by
clicking on "btnUpload" , upload doesn't happen. But if I select the
file by clicking on "filUpload" button, upload works properly.
Simulating the click event of "filUpload" only selects the file but does
not upload the file.
Any solution please?
Regards
RJN