Click here to Skip to main content
15,884,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
First Many Thanks for your site with information. I have used your Multiple File upload using jquery. Lightweight Multiple File Upload with Thumbnail Preview using HTML5 and Client Side Scripts[^]

In that After validation, the file is in the
Filelist
. If any of the validation fails the file list should not build, but the list of files are there in the tag, can u give some suggestion.
But still the file list is not clearing when the validation is failed. Due to this when i submit application the attachments are submitting. I tried some options listed below. but not success. If you give some suggestion it will be great.
Thanks in Advance
Balaji K R

What I have tried:

//To check file type according to upload conditions
            if (CheckFileType(readerEvt.type) == false) {
                alert("The file (" + readerEvt.name + ") does not match the upload conditions, You can only upload jpg/png/gif files");
				alert("hi");
				//reset_form_element( $('#Filelist') );
				$('#configform').get(0).reset();
                e.preventDefault();
                return;
            }



function reset_form_element (e) {
      alert(e);
     e.wrap('<form>').parent('form').trigger('reset');
     $('#e')[0].reset();
     e.unwrap();
    }
Posted
Comments
Peter_in_2780 5-Jun-18 22:54pm    
To reach the author of that article, it is best to ask your question in the forum at the bottom of the article. That way, the author will be notified. Here, you are just taking your chances that they will see it.
Richard Deeming 6-Jun-18 8:49am    
Never rely solely on client-side validation. It's quite simple to bypass that, either accidentally or deliberately. Always repeat the validation on the server as well.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900