Question T13001
Visible to All Users

Property to limit number of files in file upload.

created 2 years ago

Hi Team
I was working on file upload and allowing multiple file upload in a single time.
How can we limit number of files upload to let's say 10 ?

Thanks and Regards
Yash Pal Singh

Answers approved by surveyjs Support

created 2 years ago

Hello,
You can use survey.onValidateQuestion event.
Here is the example.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (1)

      You are welcome!

      Andrew
      SurveyJS Team

        Hi Andrew.
        The example that you have given above applies only when we are submitting form, how we can limit and show error when the files are uploaded.

        Thanks and Regards
        Yash

          Hi Yash,
          You can set a survey's checkErrorsMode to onValuChanged.
          Bow, a survey can validate data as soon as a user submits a response.

          Please check the updated sample: https://plnkr.co/edit/42ucypuuUfY34HBH.

          Let us know if it works for you.