Skip to content
Advertisement

How to limit multiple image selection from the gallery?

I have implemented adding multiple image selection from the gallery in my project. However, I want to limit the user so he/she can select only 3 images from the gallery.

I have implemented selecting multiple images from the gallery like this:

JavaScript

How can I achieve this?

Thanks.

Advertisement

Answer

You can get the count of ClipData when selecting multiple images from and gallery and if that count is greater than 3 you can notify the user about it.

You can do something like this after selecting images from gallery:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement