kasparkuldkepp / upload-at-click

Automatically exported from code.google.com/p/upload-at-click
0 stars 0 forks source link

Click event not fired on first time #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
How to reproduce the problem?

Please describe step by step:
1. I have called the function on button click like below :
 <div>
       <input type="button" id="uploader" value="Upload" runat="server" onclick="myfunction();" />
    </div>
2. Then I clicked on button, for the very first time the file upload window is 
NOT opened, when I clicked for second time it got opened
3. File upload window not opened on first click. Issue occurs on every 
browser(IE8+, chrome and mozilla latest version)

Optional:
5. Below is script I have used, i have added the js part in one JS function. I 
am doing this in Visual Studio 2012.
<script type="text/javascript" src="JS/upclick-min.js"></script>
    <script type="text/javascript">
        function myfunction() {
            var uploader = document.getElementById('uploader');

            upclick(
              {
                  element: uploader,
                  action: '/path_to/you_server_script.php',
                  onstart:
                    function (filename) {
                        alert('Start upload: ' + filename);
                    },
                  oncomplete:
                    function (response_data) {
                        alert(response_data);
                    }
              });
        }
    </script>

Original issue reported on code.google.com by rpundlik@gmail.com on 7 Mar 2014 at 12:39

GoogleCodeExporter commented 8 years ago
I have the same problem, but it is with a method.

Original comment by alexan...@punchmeout.ca on 9 Jul 2014 at 7:13