How to Add required validate atleast one uploader is required using javascript or anything else
Loading
How to Add required validate atleast one uploader is required using javascript or anything else
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Saravanan GanesanPosted Sep 24, 2023, 5:27 PM
To validate that at least one file uploader is required in a web form using JavaScript, check if any of the file input elements have a selected file. If none do, show an error message. You can use the
input[type="file"]:validselector in conjunction with the:invalidpseudo-class to implement this validation.Saravanan GanesanPosted Sep 24, 2023, 4:54 PM
To validate that at least one file uploader is required in a web form using JavaScript, you can use the following approach:
Mohammad HussainPosted Sep 21, 2023, 11:28 AM
Add your
asp:FileUploadcontrols to your ASP.NET page:Add a validation function and a hidden field to store the validation result in your ASP.NET page:
Add a button on your ASP.NET page and attach the
validateFileUploadfunction to itsonclickevent: