sadik7266 / jquery-multifile-plugin

Automatically exported from code.google.com/p/jquery-multifile-plugin
0 stars 0 forks source link

If asp.net required field validator is used AND the duplicate file is selected validator would be lost #126

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
workaround

in the handle error section 
Change this FROM:
    // Handle error
            if (ERROR != '') {
                // Handle error
                MultiFile.error(ERROR);

                // 2007-06-24: BUG FIX - Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
                // Ditch the trouble maker and add a fresh new element
                MultiFile.n--;
                MultiFile.addSlave(newEle[0], slave_count);
                slave.parent().prepend(newEle);
                slave.remove();

                return false;

            };

<b>TO</b> 

    // Handle error
            if (ERROR != '') {
                // Handle error
                MultiFile.error(ERROR);

                //09-26-2011: BUG FIX - if the file is duplicate and you have a validator on it this would invalidate the validator
                if(ERROR.indexOf('selected') == 0)
                {
                    // 2007-06-24: BUG FIX - Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
                    // Ditch the trouble maker and add a fresh new element
                    MultiFile.n--;
                    MultiFile.addSlave(newEle[0], slave_count);
                    slave.parent().prepend(newEle);
                    slave.remove();
                }

                return false;

            };

Original issue reported on code.google.com by chudson...@gmail.com on 26 Sep 2011 at 9:09

GoogleCodeExporter commented 8 years ago
The project has been dormant for over a year and many of the support requests 
have been resolved and/or are invalid. So we're going to archive them all, 
pending review.

If you're still having a problem with the plugin, please visit the project page 
and re-open the issue. We do apologize for any inconvenience this may cause, 
but please bear with us...  we'll be making improvements to the plugin and its 
documentation over the coming weeks.

Stay tuned; and thanks for your support!

The Fyneworks Team
http://twitter.com/fyneworks

Original comment by fyneworks on 26 Jan 2012 at 1:37

GoogleCodeExporter commented 8 years ago
I am still having this problem with my asp.net application in required filed 
validator.
When i am use required field validator and click on submit button validation 
message is displayed but file upload control is disabled. also i am using 
regular expression to check valid image file type, but it also behave same in 
asp.net 4.0.

Following is my .aspx file (HTML) code in my project....
<asp:FileUpload ID="FileUpload1" runat="server" class="multi" /><br />
    <asp:Button ID="btnUpload" runat="server" Text="Upload All"  onclick="BtnUploadClick" /><br/>

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="This field is required." ControlToValidate="FileUpload1"></asp:RequiredFieldValidator>

    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Invalid File. Please Try for Only Image Files."
    ControlToValidate="FileUpload1" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.JPG|.jpeg|.JPEG|.gif|.GIF|.png|.PNG|.bmp|.BMP|.tif|.TIF|.tiff|.TIFF)$">
    </asp:RegularExpressionValidator>

Please help out me in this issue

Original comment by jhdo...@gmail.com on 27 Jun 2012 at 11:39